@novely/solid-renderer 0.24.0 → 0.25.0
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.jsx +8 -9
- package/package.json +1 -1
package/dist/index.jsx
CHANGED
|
@@ -4105,32 +4105,31 @@ var createAudio = (storageData) => {
|
|
|
4105
4105
|
const getVolume = (type) => {
|
|
4106
4106
|
return storageData.get().meta[TYPE_META_MAP[type]];
|
|
4107
4107
|
};
|
|
4108
|
-
const getHowl = (type, src
|
|
4108
|
+
const getHowl = (type, src) => {
|
|
4109
4109
|
const kind = type === "voice" ? "voices" : type;
|
|
4110
4110
|
const cached = store[kind][src];
|
|
4111
4111
|
if (cached)
|
|
4112
4112
|
return cached;
|
|
4113
4113
|
const howl = new import_howler.Howl({
|
|
4114
4114
|
src,
|
|
4115
|
-
volume: getVolume(type)
|
|
4116
|
-
loop
|
|
4115
|
+
volume: getVolume(type)
|
|
4117
4116
|
});
|
|
4118
4117
|
store[kind][src] = howl;
|
|
4119
4118
|
return howl;
|
|
4120
4119
|
};
|
|
4121
4120
|
const context = {
|
|
4122
|
-
music(src, method
|
|
4123
|
-
const resource = getHowl(method, src
|
|
4124
|
-
resource.loop(loop);
|
|
4121
|
+
music(src, method) {
|
|
4122
|
+
const resource = getHowl(method, src);
|
|
4125
4123
|
this.start();
|
|
4126
4124
|
return {
|
|
4127
4125
|
pause() {
|
|
4128
4126
|
resource.fade(getVolume(method), 0, 300);
|
|
4129
4127
|
resource.once("fade", resource.pause);
|
|
4130
4128
|
},
|
|
4131
|
-
play() {
|
|
4129
|
+
play(loop) {
|
|
4132
4130
|
if (resource.playing())
|
|
4133
4131
|
return;
|
|
4132
|
+
resource.loop(loop);
|
|
4134
4133
|
resource.play();
|
|
4135
4134
|
resource.fade(0, getVolume(method), 300);
|
|
4136
4135
|
},
|
|
@@ -4143,7 +4142,7 @@ var createAudio = (storageData) => {
|
|
|
4143
4142
|
voice(source) {
|
|
4144
4143
|
this.start();
|
|
4145
4144
|
this.voiceStop();
|
|
4146
|
-
const resource = store.voice = getHowl("voice", source
|
|
4145
|
+
const resource = store.voice = getHowl("voice", source);
|
|
4147
4146
|
resource.once("end", () => {
|
|
4148
4147
|
store.voice = void 0;
|
|
4149
4148
|
});
|
|
@@ -4989,7 +4988,7 @@ var Save = (props) => {
|
|
|
4989
4988
|
const [iframe, setIframe] = createSignal();
|
|
4990
4989
|
const [timestamp, type] = props.save[2];
|
|
4991
4990
|
const date = new Date(timestamp);
|
|
4992
|
-
const KEY = `save-${date}-${type}`;
|
|
4991
|
+
const KEY = `save-${Number(date)}-${type}`;
|
|
4993
4992
|
const $contextState = useContextState(KEY);
|
|
4994
4993
|
const context = getContext(KEY);
|
|
4995
4994
|
const year = date.getFullYear();
|