mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 12:08:28 +00:00
hotfix: fix share #261
This commit is contained in:
parent
2e8a1b67ea
commit
4313fe670d
2
packages/react/dist/index.cjs.js
vendored
2
packages/react/dist/index.cjs.js
vendored
File diff suppressed because one or more lines are too long
28
packages/react/dist/index.es.js
vendored
28
packages/react/dist/index.es.js
vendored
@ -127,8 +127,8 @@ function le({ view: e, pattern: t, active: o, getTime: a }) {
|
|||||||
try {
|
try {
|
||||||
const c = a(), g = [Math.max(m.current || c, c - 1 / 10, 0), c + 1 / 60];
|
const c = a(), g = [Math.max(m.current || c, c - 1 / 10, 0), c + 1 / 60];
|
||||||
m.current = g[1], s.current = s.current.filter((p) => p.whole.end > c);
|
m.current = g[1], s.current = s.current.filter((p) => p.whole.end > c);
|
||||||
const v = t.queryArc(...g).filter((p) => p.hasOnset());
|
const h = t.queryArc(...g).filter((p) => p.hasOnset());
|
||||||
s.current = s.current.concat(v), e.dispatch({ effects: A.of(s.current) });
|
s.current = s.current.concat(h), e.dispatch({ effects: A.of(s.current) });
|
||||||
} catch {
|
} catch {
|
||||||
e.dispatch({ effects: A.of([]) });
|
e.dispatch({ effects: A.of([]) });
|
||||||
}
|
}
|
||||||
@ -186,11 +186,11 @@ function ve({
|
|||||||
onEvalError: c,
|
onEvalError: c,
|
||||||
onToggle: i
|
onToggle: i
|
||||||
}) {
|
}) {
|
||||||
const [g, v] = w(), [p, D] = w(), [h, k] = w(s), [y, P] = w(h), [z, _] = w(), [C, H] = w(!1), F = h !== y, { scheduler: u, evaluate: L, start: $, stop: G, pause: J } = I(
|
const [g, h] = w(), [p, D] = w(), [v, k] = w(s), [y, P] = w(), [z, _] = w(), [C, H] = w(!1), F = v !== y, { scheduler: u, evaluate: L, start: $, stop: G, pause: J } = I(
|
||||||
() => te({
|
() => te({
|
||||||
interval: t,
|
interval: t,
|
||||||
defaultOutput: e,
|
defaultOutput: e,
|
||||||
onSchedulerError: v,
|
onSchedulerError: h,
|
||||||
onEvalError: (f) => {
|
onEvalError: (f) => {
|
||||||
D(f), c?.(f);
|
D(f), c?.(f);
|
||||||
},
|
},
|
||||||
@ -200,20 +200,20 @@ function ve({
|
|||||||
k(f), l?.();
|
k(f), l?.();
|
||||||
},
|
},
|
||||||
afterEval: ({ pattern: f, code: S }) => {
|
afterEval: ({ pattern: f, code: S }) => {
|
||||||
P(S), _(f), D(), v(), m && (window.location.hash = "#" + encodeURIComponent(btoa(S))), d?.();
|
P(S), _(f), D(), h(), m && (window.location.hash = "#" + encodeURIComponent(btoa(S))), d?.();
|
||||||
},
|
},
|
||||||
onToggle: (f) => {
|
onToggle: (f) => {
|
||||||
H(f), i?.(f);
|
H(f), i?.(f);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
[e, t, o]
|
[e, t, o]
|
||||||
), M = N(async (f = !0) => L(h, f), [L, h]), V = x();
|
), M = N(async (f = !0) => L(v, f), [L, v]), V = x();
|
||||||
return R(() => {
|
return R(() => {
|
||||||
!V.current && a && h && (V.current = !0, M());
|
!V.current && a && v && (V.current = !0, M());
|
||||||
}, [M, a, h]), R(() => () => {
|
}, [M, a, v]), R(() => () => {
|
||||||
u.stop();
|
u.stop();
|
||||||
}, [u]), {
|
}, [u]), {
|
||||||
code: h,
|
code: v,
|
||||||
setCode: k,
|
setCode: k,
|
||||||
error: g || p,
|
error: g || p,
|
||||||
schedulerError: g,
|
schedulerError: g,
|
||||||
@ -243,10 +243,10 @@ function Pe({ tune: e, hideOutsideView: t = !1, init: o, enableKeyboard: a }) {
|
|||||||
error: c,
|
error: c,
|
||||||
isDirty: i,
|
isDirty: i,
|
||||||
activeCode: g,
|
activeCode: g,
|
||||||
pattern: v,
|
pattern: h,
|
||||||
started: p,
|
started: p,
|
||||||
scheduler: D,
|
scheduler: D,
|
||||||
togglePlay: h,
|
togglePlay: v,
|
||||||
stop: k
|
stop: k
|
||||||
} = ve({
|
} = ve({
|
||||||
initialCode: e,
|
initialCode: e,
|
||||||
@ -257,7 +257,7 @@ function Pe({ tune: e, hideOutsideView: t = !1, init: o, enableKeyboard: a }) {
|
|||||||
}), C = x(), H = I(() => ((_ || !t) && (C.current = !0), _ || C.current), [_, t]);
|
}), C = x(), H = I(() => ((_ || !t) && (C.current = !0), _ || C.current), [_, t]);
|
||||||
return le({
|
return le({
|
||||||
view: y,
|
view: y,
|
||||||
pattern: v,
|
pattern: h,
|
||||||
active: p && !g?.includes("strudel disable-highlighting"),
|
active: p && !g?.includes("strudel disable-highlighting"),
|
||||||
getTime: () => D.getPhase()
|
getTime: () => D.getPhase()
|
||||||
}), K(() => {
|
}), K(() => {
|
||||||
@ -267,7 +267,7 @@ function Pe({ tune: e, hideOutsideView: t = !1, init: o, enableKeyboard: a }) {
|
|||||||
};
|
};
|
||||||
return window.addEventListener("keydown", F, !0), () => window.removeEventListener("keydown", F, !0);
|
return window.addEventListener("keydown", F, !0), () => window.removeEventListener("keydown", F, !0);
|
||||||
}
|
}
|
||||||
}, [a, v, s, l, k, y]), /* @__PURE__ */ n.createElement("div", {
|
}, [a, h, s, l, k, y]), /* @__PURE__ */ n.createElement("div", {
|
||||||
className: b.container,
|
className: b.container,
|
||||||
ref: z
|
ref: z
|
||||||
}, /* @__PURE__ */ n.createElement("div", {
|
}, /* @__PURE__ */ n.createElement("div", {
|
||||||
@ -276,7 +276,7 @@ function Pe({ tune: e, hideOutsideView: t = !1, init: o, enableKeyboard: a }) {
|
|||||||
className: b.buttons
|
className: b.buttons
|
||||||
}, /* @__PURE__ */ n.createElement("button", {
|
}, /* @__PURE__ */ n.createElement("button", {
|
||||||
className: B(b.button, p ? "sc-animate-pulse" : ""),
|
className: B(b.button, p ? "sc-animate-pulse" : ""),
|
||||||
onClick: () => h()
|
onClick: () => v()
|
||||||
}, /* @__PURE__ */ n.createElement(q, {
|
}, /* @__PURE__ */ n.createElement(q, {
|
||||||
type: p ? "pause" : "play"
|
type: p ? "pause" : "play"
|
||||||
})), /* @__PURE__ */ n.createElement("button", {
|
})), /* @__PURE__ */ n.createElement("button", {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ function useStrudel({
|
|||||||
const [schedulerError, setSchedulerError] = useState();
|
const [schedulerError, setSchedulerError] = useState();
|
||||||
const [evalError, setEvalError] = useState();
|
const [evalError, setEvalError] = useState();
|
||||||
const [code, setCode] = useState(initialCode);
|
const [code, setCode] = useState(initialCode);
|
||||||
const [activeCode, setActiveCode] = useState(code);
|
const [activeCode, setActiveCode] = useState();
|
||||||
const [pattern, setPattern] = useState();
|
const [pattern, setPattern] = useState();
|
||||||
const [started, setStarted] = useState(false);
|
const [started, setStarted] = useState(false);
|
||||||
const isDirty = code !== activeCode;
|
const isDirty = code !== activeCode;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user