@scalemule/nextjs 0.1.46 → 0.1.47
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/audio.d.mts +5 -0
- package/dist/audio.d.ts +5 -0
- package/dist/audio.js +1 -12
- package/dist/audio.mjs +1 -12
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -44
- package/dist/index.mjs +13 -44
- package/package.json +1 -1
package/dist/audio.d.mts
CHANGED
|
@@ -42,6 +42,11 @@ interface AudioPlayerProps {
|
|
|
42
42
|
preload?: 'none' | 'metadata';
|
|
43
43
|
/** Called at most once automatically per play attempt. Honor signal to cancel network work. */
|
|
44
44
|
onRefresh?: (signal: AbortSignal) => Promise<AudioPlayerSource>;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated No-op. Players never show a manual Refresh control: expired
|
|
47
|
+
* URLs are refreshed silently through `onRefresh`. Kept so existing callers
|
|
48
|
+
* still compile.
|
|
49
|
+
*/
|
|
45
50
|
showRefreshButton?: boolean;
|
|
46
51
|
onPlaybackError?: () => void;
|
|
47
52
|
/** Shared with the existing ScaleMule blog player. Set null to disable persistence. */
|
package/dist/audio.d.ts
CHANGED
|
@@ -42,6 +42,11 @@ interface AudioPlayerProps {
|
|
|
42
42
|
preload?: 'none' | 'metadata';
|
|
43
43
|
/** Called at most once automatically per play attempt. Honor signal to cancel network work. */
|
|
44
44
|
onRefresh?: (signal: AbortSignal) => Promise<AudioPlayerSource>;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated No-op. Players never show a manual Refresh control: expired
|
|
47
|
+
* URLs are refreshed silently through `onRefresh`. Kept so existing callers
|
|
48
|
+
* still compile.
|
|
49
|
+
*/
|
|
45
50
|
showRefreshButton?: boolean;
|
|
46
51
|
onPlaybackError?: () => void;
|
|
47
52
|
/** Shared with the existing ScaleMule blog player. Set null to disable persistence. */
|
package/dist/audio.js
CHANGED
|
@@ -364,7 +364,6 @@ function PlayerSession({
|
|
|
364
364
|
style,
|
|
365
365
|
preload = "none",
|
|
366
366
|
onRefresh,
|
|
367
|
-
showRefreshButton = false,
|
|
368
367
|
onPlaybackError,
|
|
369
368
|
playbackRateStorageKey = "scalemule:audio:playback-rate",
|
|
370
369
|
exclusivePlayback = true,
|
|
@@ -780,19 +779,9 @@ function PlayerSession({
|
|
|
780
779
|
"\xD7"
|
|
781
780
|
]
|
|
782
781
|
}
|
|
783
|
-
),
|
|
784
|
-
onRefresh && showRefreshButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
785
|
-
"button",
|
|
786
|
-
{
|
|
787
|
-
type: "button",
|
|
788
|
-
className: "sm-audio__refresh",
|
|
789
|
-
disabled: busy,
|
|
790
|
-
onClick: () => void recover(true),
|
|
791
|
-
children: "Refresh"
|
|
792
|
-
}
|
|
793
782
|
)
|
|
794
783
|
] }),
|
|
795
|
-
(busy || error) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "sm-audio__status", role: "status", children: busy ? "
|
|
784
|
+
(busy || error) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "sm-audio__status", role: "status", children: busy ? "Loading audio\u2026" : error })
|
|
796
785
|
]
|
|
797
786
|
}
|
|
798
787
|
);
|
package/dist/audio.mjs
CHANGED
|
@@ -340,7 +340,6 @@ function PlayerSession({
|
|
|
340
340
|
style,
|
|
341
341
|
preload = "none",
|
|
342
342
|
onRefresh,
|
|
343
|
-
showRefreshButton = false,
|
|
344
343
|
onPlaybackError,
|
|
345
344
|
playbackRateStorageKey = "scalemule:audio:playback-rate",
|
|
346
345
|
exclusivePlayback = true,
|
|
@@ -756,19 +755,9 @@ function PlayerSession({
|
|
|
756
755
|
"\xD7"
|
|
757
756
|
]
|
|
758
757
|
}
|
|
759
|
-
),
|
|
760
|
-
onRefresh && showRefreshButton && /* @__PURE__ */ jsx(
|
|
761
|
-
"button",
|
|
762
|
-
{
|
|
763
|
-
type: "button",
|
|
764
|
-
className: "sm-audio__refresh",
|
|
765
|
-
disabled: busy,
|
|
766
|
-
onClick: () => void recover(true),
|
|
767
|
-
children: "Refresh"
|
|
768
|
-
}
|
|
769
758
|
)
|
|
770
759
|
] }),
|
|
771
|
-
(busy || error) && /* @__PURE__ */ jsx("p", { className: "sm-audio__status", role: "status", children: busy ? "
|
|
760
|
+
(busy || error) && /* @__PURE__ */ jsx("p", { className: "sm-audio__status", role: "status", children: busy ? "Loading audio\u2026" : error })
|
|
772
761
|
]
|
|
773
762
|
}
|
|
774
763
|
);
|
package/dist/index.d.mts
CHANGED
|
@@ -486,10 +486,11 @@ interface NarrationPlayerProps {
|
|
|
486
486
|
narrationLabel?: string;
|
|
487
487
|
refreshing?: boolean;
|
|
488
488
|
onRefresh?: () => void | Promise<void>;
|
|
489
|
+
/** @deprecated No-op: no manual Refresh control is ever shown. */
|
|
489
490
|
showRefreshButton?: boolean;
|
|
490
491
|
onPlaybackError?: () => void;
|
|
491
492
|
}
|
|
492
|
-
declare function NarrationPlayer({ audio, className, providerLabel, narrationLabel, refreshing, onRefresh,
|
|
493
|
+
declare function NarrationPlayer({ audio, className, providerLabel, narrationLabel, refreshing, onRefresh, onPlaybackError, }: NarrationPlayerProps): react_jsx_runtime.JSX.Element | null;
|
|
493
494
|
|
|
494
495
|
/**
|
|
495
496
|
* Conversation kinds recognized by the chat realtime channel naming scheme.
|
package/dist/index.d.ts
CHANGED
|
@@ -486,10 +486,11 @@ interface NarrationPlayerProps {
|
|
|
486
486
|
narrationLabel?: string;
|
|
487
487
|
refreshing?: boolean;
|
|
488
488
|
onRefresh?: () => void | Promise<void>;
|
|
489
|
+
/** @deprecated No-op: no manual Refresh control is ever shown. */
|
|
489
490
|
showRefreshButton?: boolean;
|
|
490
491
|
onPlaybackError?: () => void;
|
|
491
492
|
}
|
|
492
|
-
declare function NarrationPlayer({ audio, className, providerLabel, narrationLabel, refreshing, onRefresh,
|
|
493
|
+
declare function NarrationPlayer({ audio, className, providerLabel, narrationLabel, refreshing, onRefresh, onPlaybackError, }: NarrationPlayerProps): react_jsx_runtime.JSX.Element | null;
|
|
493
494
|
|
|
494
495
|
/**
|
|
495
496
|
* Conversation kinds recognized by the chat realtime channel naming scheme.
|
package/dist/index.js
CHANGED
|
@@ -2979,19 +2979,7 @@ var styles = {
|
|
|
2979
2979
|
color: "#334155",
|
|
2980
2980
|
boxShadow: "0 1px 3px rgba(15, 23, 42, 0.08)",
|
|
2981
2981
|
cursor: "pointer"
|
|
2982
|
-
}
|
|
2983
|
-
refreshButton: {
|
|
2984
|
-
borderRadius: "9999px",
|
|
2985
|
-
border: "1px solid #cad5e2",
|
|
2986
|
-
backgroundColor: "rgba(255, 255, 255, 0.75)",
|
|
2987
|
-
padding: "0.5rem 1rem",
|
|
2988
|
-
fontSize: "0.875rem",
|
|
2989
|
-
fontWeight: 600,
|
|
2990
|
-
color: "#334155",
|
|
2991
|
-
cursor: "pointer"
|
|
2992
|
-
},
|
|
2993
|
-
disabled: { cursor: "not-allowed", opacity: 0.6 }
|
|
2994
|
-
};
|
|
2982
|
+
}};
|
|
2995
2983
|
function NarrationPlayer({
|
|
2996
2984
|
audio,
|
|
2997
2985
|
className,
|
|
@@ -2999,7 +2987,6 @@ function NarrationPlayer({
|
|
|
2999
2987
|
narrationLabel = "AI-Narrated",
|
|
3000
2988
|
refreshing = false,
|
|
3001
2989
|
onRefresh,
|
|
3002
|
-
showRefreshButton = false,
|
|
3003
2990
|
onPlaybackError
|
|
3004
2991
|
}) {
|
|
3005
2992
|
const audioRef = React.useRef(null);
|
|
@@ -3130,12 +3117,6 @@ function NarrationPlayer({
|
|
|
3130
3117
|
break;
|
|
3131
3118
|
}
|
|
3132
3119
|
}
|
|
3133
|
-
function handleManualRefresh() {
|
|
3134
|
-
if (!onRefresh || refreshing) return;
|
|
3135
|
-
Promise.resolve(onRefresh()).catch(() => {
|
|
3136
|
-
onPlaybackError?.();
|
|
3137
|
-
});
|
|
3138
|
-
}
|
|
3139
3120
|
const progress = duration > 0 ? Math.min(1, currentTime / duration) : 0;
|
|
3140
3121
|
const expiresLabel = audio.expires_at ? new Date(audio.expires_at).toLocaleTimeString([], {
|
|
3141
3122
|
hour: "numeric",
|
|
@@ -3258,30 +3239,18 @@ function NarrationPlayer({
|
|
|
3258
3239
|
] })
|
|
3259
3240
|
] })
|
|
3260
3241
|
] }),
|
|
3261
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
),
|
|
3274
|
-
onRefresh && showRefreshButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3275
|
-
"button",
|
|
3276
|
-
{
|
|
3277
|
-
type: "button",
|
|
3278
|
-
onClick: handleManualRefresh,
|
|
3279
|
-
disabled: refreshing,
|
|
3280
|
-
style: refreshing ? { ...styles.refreshButton, ...styles.disabled } : styles.refreshButton,
|
|
3281
|
-
children: refreshing ? "Refreshing\u2026" : "Refresh"
|
|
3282
|
-
}
|
|
3283
|
-
)
|
|
3284
|
-
] })
|
|
3242
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles.controls, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3243
|
+
"button",
|
|
3244
|
+
{
|
|
3245
|
+
type: "button",
|
|
3246
|
+
onClick: () => setSpeed((currentSpeed) => getNextSpeed(currentSpeed)),
|
|
3247
|
+
style: styles.secondaryButton,
|
|
3248
|
+
children: [
|
|
3249
|
+
speed,
|
|
3250
|
+
"\xD7"
|
|
3251
|
+
]
|
|
3252
|
+
}
|
|
3253
|
+
) })
|
|
3285
3254
|
] })
|
|
3286
3255
|
] });
|
|
3287
3256
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2959,19 +2959,7 @@ var styles = {
|
|
|
2959
2959
|
color: "#334155",
|
|
2960
2960
|
boxShadow: "0 1px 3px rgba(15, 23, 42, 0.08)",
|
|
2961
2961
|
cursor: "pointer"
|
|
2962
|
-
}
|
|
2963
|
-
refreshButton: {
|
|
2964
|
-
borderRadius: "9999px",
|
|
2965
|
-
border: "1px solid #cad5e2",
|
|
2966
|
-
backgroundColor: "rgba(255, 255, 255, 0.75)",
|
|
2967
|
-
padding: "0.5rem 1rem",
|
|
2968
|
-
fontSize: "0.875rem",
|
|
2969
|
-
fontWeight: 600,
|
|
2970
|
-
color: "#334155",
|
|
2971
|
-
cursor: "pointer"
|
|
2972
|
-
},
|
|
2973
|
-
disabled: { cursor: "not-allowed", opacity: 0.6 }
|
|
2974
|
-
};
|
|
2962
|
+
}};
|
|
2975
2963
|
function NarrationPlayer({
|
|
2976
2964
|
audio,
|
|
2977
2965
|
className,
|
|
@@ -2979,7 +2967,6 @@ function NarrationPlayer({
|
|
|
2979
2967
|
narrationLabel = "AI-Narrated",
|
|
2980
2968
|
refreshing = false,
|
|
2981
2969
|
onRefresh,
|
|
2982
|
-
showRefreshButton = false,
|
|
2983
2970
|
onPlaybackError
|
|
2984
2971
|
}) {
|
|
2985
2972
|
const audioRef = useRef(null);
|
|
@@ -3110,12 +3097,6 @@ function NarrationPlayer({
|
|
|
3110
3097
|
break;
|
|
3111
3098
|
}
|
|
3112
3099
|
}
|
|
3113
|
-
function handleManualRefresh() {
|
|
3114
|
-
if (!onRefresh || refreshing) return;
|
|
3115
|
-
Promise.resolve(onRefresh()).catch(() => {
|
|
3116
|
-
onPlaybackError?.();
|
|
3117
|
-
});
|
|
3118
|
-
}
|
|
3119
3100
|
const progress = duration > 0 ? Math.min(1, currentTime / duration) : 0;
|
|
3120
3101
|
const expiresLabel = audio.expires_at ? new Date(audio.expires_at).toLocaleTimeString([], {
|
|
3121
3102
|
hour: "numeric",
|
|
@@ -3238,30 +3219,18 @@ function NarrationPlayer({
|
|
|
3238
3219
|
] })
|
|
3239
3220
|
] })
|
|
3240
3221
|
] }),
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
),
|
|
3254
|
-
onRefresh && showRefreshButton && /* @__PURE__ */ jsx(
|
|
3255
|
-
"button",
|
|
3256
|
-
{
|
|
3257
|
-
type: "button",
|
|
3258
|
-
onClick: handleManualRefresh,
|
|
3259
|
-
disabled: refreshing,
|
|
3260
|
-
style: refreshing ? { ...styles.refreshButton, ...styles.disabled } : styles.refreshButton,
|
|
3261
|
-
children: refreshing ? "Refreshing\u2026" : "Refresh"
|
|
3262
|
-
}
|
|
3263
|
-
)
|
|
3264
|
-
] })
|
|
3222
|
+
/* @__PURE__ */ jsx("div", { style: styles.controls, children: /* @__PURE__ */ jsxs(
|
|
3223
|
+
"button",
|
|
3224
|
+
{
|
|
3225
|
+
type: "button",
|
|
3226
|
+
onClick: () => setSpeed((currentSpeed) => getNextSpeed(currentSpeed)),
|
|
3227
|
+
style: styles.secondaryButton,
|
|
3228
|
+
children: [
|
|
3229
|
+
speed,
|
|
3230
|
+
"\xD7"
|
|
3231
|
+
]
|
|
3232
|
+
}
|
|
3233
|
+
) })
|
|
3265
3234
|
] })
|
|
3266
3235
|
] });
|
|
3267
3236
|
}
|
package/package.json
CHANGED