@hyperframes/studio 0.9.51 → 0.9.53
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/assets/{hyperframes-player-i4dtJlrd.js → hyperframes-player-z7r-N5fm.js} +2 -2
- package/dist/assets/{index-Be_pDhIw.js → index-2QPHxCxy.js} +1 -1
- package/dist/assets/{index-CU24FmKd.css → index-CRiuMxyq.css} +1 -1
- package/dist/assets/{index-Dvlt50yp.js → index-Dpo7Q_9-.js} +160 -160
- package/dist/assets/index-Dv67Vrl6.js +74 -0
- package/dist/assets/{pausedVideoDecoder-C_20YkSR.js → pausedVideoDecoder-BarDYEAf.js} +1 -1
- package/dist/{chunk-67DSVBEI.js → chunk-F6EHWNZU.js} +1 -1
- package/dist/{chunk-ZNUWV4FN.js → chunk-G6FJSL7X.js} +16 -8
- package/dist/chunk-USW3YBOG.js +70 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.html +2 -2
- package/dist/index.js +49 -79
- package/dist/keys.d.ts +72 -1
- package/dist/keys.js +5 -4
- package/dist/player.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/ui.d.ts +3 -1
- package/dist/ui.js +3 -1
- package/package.json +9 -9
- package/src/captions/keyboard.ts +1 -1
- package/src/components/RightPanelTabs.test.tsx +1 -1
- package/src/components/StudioHeader.dom.test.tsx +1 -1
- package/src/components/TimelineHistoryButtons.dom.test.tsx +1 -1
- package/src/components/TimelineToolbar.tsx +1 -1
- package/src/components/editor/SnapToolbar.tsx +1 -1
- package/src/components/editor/useDomEditNudge.ts +1 -1
- package/src/components/panels/SlideshowPanel.tsx +1 -1
- package/src/components/renders/RenderQueue.test.tsx +1 -1
- package/src/components/ui/Button.test.tsx +1 -1
- package/src/components/ui/Menu.test.tsx +6 -4
- package/src/components/ui/Menu.tsx +8 -5
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/valueControls.test.tsx +1 -1
- package/src/hooks/appHotkeysDispatch.ts +1 -1
- package/src/hooks/linkShortcuts.ts +1 -1
- package/src/hooks/useAutomationSelectionKeyboard.ts +1 -1
- package/src/hooks/useKeyframeKeyboard.ts +1 -1
- package/src/index.ts +2 -2
- package/src/keys.test.ts +5 -7
- package/src/keys.ts +1 -6
- package/src/player/components/ShortcutsPanel.tsx +1 -1
- package/src/player/components/studioCombo.test.ts +1 -1
- package/src/player/components/studioShortcuts.ts +1 -1
- package/src/player/lib/playbackShortcuts.ts +3 -28
- package/src/ui.ts +1 -0
- package/src/utils/studioHelpers.ts +1 -1
- package/src/utils/studioPendingEdits.ts +1 -1
- package/src/utils/timelineDiscovery.ts +1 -1
- package/src/utils/typingTarget.test.ts +1 -1
- package/src/webmcp/polyfill.transport.test.ts +13 -3
- package/src/webmcp/types.ts +3 -3
- package/src/webmcp/useStudioAgentTools.polyfill.test.tsx +89 -121
- package/src/webmcp/useStudioAgentTools.test.tsx +2 -2
- package/src/webmcp/useStudioAgentTools.ts +2 -3
- package/dist/assets/index-BX3KHhGX.js +0 -71
- package/dist/chunk-5ZHKYODQ.js +0 -149
- package/dist/keys-B163OjLN.d.ts +0 -87
- package/src/player/components/studioCombo.ts +0 -108
- package/src/utils/typingTarget.ts +0 -56
package/dist/ui.d.ts
CHANGED
|
@@ -122,6 +122,8 @@ type PortalContainer = ComponentPropsWithoutRef<typeof Menu$1.Portal>["container
|
|
|
122
122
|
* Chrome shared by every floating panel (`Popover` too); callers add their own shadow token.
|
|
123
123
|
*/
|
|
124
124
|
declare const popupSurface: string;
|
|
125
|
+
/** One row. `data-highlighted` is set by keyboard and pointer alike, so the seen row is the Enter row. */
|
|
126
|
+
declare const menuItemBase: string;
|
|
125
127
|
type MenuItemTone = "default" | "danger";
|
|
126
128
|
interface PositionedProps {
|
|
127
129
|
side?: "top" | "bottom" | "left" | "right";
|
|
@@ -298,4 +300,4 @@ interface ToggleProps {
|
|
|
298
300
|
}
|
|
299
301
|
declare function Toggle({ label, checked, onCommit, onTrack, disabled, className, "data-preview-state": previewState, }: ToggleProps): react_jsx_runtime.JSX.Element;
|
|
300
302
|
|
|
301
|
-
export { Button, type ButtonSize, type ButtonVariant, ContextMenu, HyperframesLoader, type HyperframesLoaderProps, HyperframesLogo, IconButton, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NumberField, type NumberFieldProps, Popover, type PopupPreviewState, type PreviewState, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Tab, TabPanel, Tabs, TabsList, Toggle, type ToggleProps, Tooltip, buttonBase, buttonSizes, buttonVariants, cn, fieldBase, fieldText, popupSurface };
|
|
303
|
+
export { Button, type ButtonSize, type ButtonVariant, ContextMenu, HyperframesLoader, type HyperframesLoaderProps, HyperframesLogo, IconButton, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NumberField, type NumberFieldProps, Popover, type PopupPreviewState, type PreviewState, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Tab, TabPanel, Tabs, TabsList, Toggle, type ToggleProps, Tooltip, buttonBase, buttonSizes, buttonVariants, cn, fieldBase, fieldText, menuItemBase, popupSurface };
|
package/dist/ui.js
CHANGED
|
@@ -29,8 +29,9 @@ import {
|
|
|
29
29
|
cn,
|
|
30
30
|
fieldBase,
|
|
31
31
|
fieldText,
|
|
32
|
+
menuItemBase,
|
|
32
33
|
popupSurface
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-G6FJSL7X.js";
|
|
34
35
|
import "./chunk-MLKGABMK.js";
|
|
35
36
|
export {
|
|
36
37
|
Button,
|
|
@@ -61,5 +62,6 @@ export {
|
|
|
61
62
|
cn,
|
|
62
63
|
fieldBase,
|
|
63
64
|
fieldText,
|
|
65
|
+
menuItemBase,
|
|
64
66
|
popupSurface
|
|
65
67
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/studio",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.53",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@codemirror/state": "^6.6.0",
|
|
57
57
|
"@codemirror/view": "6.40.0",
|
|
58
58
|
"@lezer/highlight": "^1.2.3",
|
|
59
|
-
"@mcp-b/global": "^
|
|
59
|
+
"@mcp-b/global": "^6.1.0",
|
|
60
60
|
"@phosphor-icons/react": "^2.1.10",
|
|
61
61
|
"@tanstack/react-virtual": "^3.14.13",
|
|
62
62
|
"acorn": "^8.17.0",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"dockview-react": "8.3.1",
|
|
65
65
|
"gsap": "^3.13.0",
|
|
66
66
|
"mediabunny": "^1.66.0",
|
|
67
|
-
"@hyperframes/core": "0.9.
|
|
68
|
-
"@hyperframes/
|
|
69
|
-
"@hyperframes/
|
|
70
|
-
"@hyperframes/sdk": "0.9.
|
|
71
|
-
"@hyperframes/
|
|
72
|
-
"@hyperframes/
|
|
67
|
+
"@hyperframes/core": "0.9.53",
|
|
68
|
+
"@hyperframes/parsers": "0.9.53",
|
|
69
|
+
"@hyperframes/player": "0.9.53",
|
|
70
|
+
"@hyperframes/sdk": "0.9.53",
|
|
71
|
+
"@hyperframes/shader-transitions": "0.9.53",
|
|
72
|
+
"@hyperframes/studio-server": "0.9.53"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"vite": "^6.4.5",
|
|
87
87
|
"vitest": "^4.1.12",
|
|
88
88
|
"zustand": "^5.0.0",
|
|
89
|
-
"@hyperframes/producer": "0.9.
|
|
89
|
+
"@hyperframes/producer": "0.9.53"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"react": "19",
|
package/src/captions/keyboard.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEditableTarget } from "../utils/timelineDiscovery";
|
|
2
|
-
import { ownsPlainKeys } from "
|
|
2
|
+
import { ownsPlainKeys } from "@hyperframes/core/typing-target";
|
|
3
3
|
import { resolveCanvasNudgeDelta } from "../components/editor/domEditNudge";
|
|
4
4
|
|
|
5
5
|
type CaptionNudgeKeyEvent = Parameters<typeof resolveCanvasNudgeDelta>[0];
|
|
@@ -8,7 +8,7 @@ import React, { act } from "react";
|
|
|
8
8
|
import { createRoot, type Root } from "react-dom/client";
|
|
9
9
|
import { afterEach, expect, it, vi } from "vitest";
|
|
10
10
|
import { RightPanelTabs, type RightPanelTabDescriptor } from "./RightPanelTabs";
|
|
11
|
-
import { isTypingTarget } from "
|
|
11
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
12
12
|
import { shouldIgnorePlaybackShortcutTarget } from "../player/lib/playbackShortcuts";
|
|
13
13
|
|
|
14
14
|
(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
@@ -8,7 +8,7 @@ import React, { act } from "react";
|
|
|
8
8
|
import { createRoot, type Root } from "react-dom/client";
|
|
9
9
|
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
|
10
10
|
import { buttonSizes, buttonVariants } from "./ui";
|
|
11
|
-
import { isTypingTarget } from "
|
|
11
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
12
12
|
import { shouldIgnorePlaybackShortcutTarget } from "../player/lib/playbackShortcuts";
|
|
13
13
|
|
|
14
14
|
(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { act } from "react";
|
|
4
4
|
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
|
5
5
|
import { cleanupMounted, mountHost } from "./ui/mountHost.testHelpers";
|
|
6
|
-
import { isTypingTarget } from "
|
|
6
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
7
7
|
import { shouldIgnorePlaybackShortcutTarget } from "../player/lib/playbackShortcuts";
|
|
8
8
|
|
|
9
9
|
const editHistory = {
|
|
@@ -39,7 +39,7 @@ import { useAudioMetersVisible } from "../utils/audioMeterVisibility";
|
|
|
39
39
|
import { LinkedSelectionToggle } from "./LinkedSelectionToggle";
|
|
40
40
|
import { useProjectHasAudio } from "../utils/audioMeterMath";
|
|
41
41
|
import { canAddBeatAt, addBeatAtCompositionTime } from "../utils/beatEditActions";
|
|
42
|
-
import { isTypingTarget } from "
|
|
42
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
43
43
|
import { keyHint, matchesKey, useStudioKeys } from "../player/components/studioShortcuts";
|
|
44
44
|
import type { TimelineProps } from "../player/components/TimelineTypes";
|
|
45
45
|
|
|
@@ -3,7 +3,7 @@ import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
|
3
3
|
import { MagnetStraight, GridFour, Path, Ruler, FrameCorners } from "@phosphor-icons/react";
|
|
4
4
|
import { usePlayerStore } from "../../player/store/playerStore";
|
|
5
5
|
import { usePreviewOverlayContext } from "./PreviewOverlayProvider";
|
|
6
|
-
import { ownsPlainKeys } from "
|
|
6
|
+
import { ownsPlainKeys } from "@hyperframes/core/typing-target";
|
|
7
7
|
import { keyHint, matchesKey, useStudioKeys } from "../../player/components/studioShortcuts";
|
|
8
8
|
|
|
9
9
|
// fallow-ignore-next-line complexity
|
|
@@ -8,7 +8,7 @@ import { trackPreviewEditResult } from "../../utils/previewFeatureUsage";
|
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback, useEffect, useRef, type RefObject } from "react";
|
|
10
10
|
import { useMountEffect } from "../../hooks/useMountEffect";
|
|
11
|
-
import { ownsPlainKeys } from "
|
|
11
|
+
import { ownsPlainKeys } from "@hyperframes/core/typing-target";
|
|
12
12
|
import { acquireCanvasNudgeKeys } from "../../utils/canvasNudgeGate";
|
|
13
13
|
import {
|
|
14
14
|
addStudioPendingEditFlushListener,
|
|
@@ -21,7 +21,7 @@ import { usePlayerStore } from "../../player";
|
|
|
21
21
|
import { useDomEditSelectionContext } from "../../contexts/DomEditContext";
|
|
22
22
|
import { useFileManagerContext } from "../../contexts/FileManagerContext";
|
|
23
23
|
import { generateId } from "../../utils/generateId";
|
|
24
|
-
import { isTypingTarget } from "
|
|
24
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
25
25
|
import {
|
|
26
26
|
SectionHeader,
|
|
27
27
|
SlideList,
|
|
@@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vite
|
|
|
6
6
|
import { RenderQueue, type StartRenderHandler } from "./RenderQueue";
|
|
7
7
|
import { getPersistedRenderSettings } from "./renderSettings";
|
|
8
8
|
import { buttonBase, buttonSizes, buttonVariants, cn } from "../ui";
|
|
9
|
-
import { isTypingTarget } from "
|
|
9
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
10
10
|
import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts";
|
|
11
11
|
import type { FfmpegStatus } from "./useFfmpegStatus";
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ import { Button, type ButtonSize, type ButtonVariant } from "./Button";
|
|
|
14
14
|
import { IconButton } from "./IconButton";
|
|
15
15
|
import { Tab, Tabs, TabsList } from "./Tabs";
|
|
16
16
|
import { cleanupMounted, mountHost } from "./mountHost.testHelpers";
|
|
17
|
-
import { isTypingTarget } from "
|
|
17
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
18
18
|
import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts";
|
|
19
19
|
|
|
20
20
|
const VARIANTS: ButtonVariant[] = ["primary", "secondary", "danger", "ghost"];
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
MenuSeparator,
|
|
17
17
|
} from "./Menu";
|
|
18
18
|
import { Popover } from "./Popover";
|
|
19
|
-
import { isTypingTarget } from "
|
|
19
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
20
20
|
import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts";
|
|
21
21
|
import { cleanupMounted, mountHost as render } from "./mountHost.testHelpers";
|
|
22
22
|
|
|
@@ -443,12 +443,14 @@ describe("open motion", () => {
|
|
|
443
443
|
);
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
it("rounds a row's highlight
|
|
446
|
+
it("rounds a row's highlight to the panel's corner less the panel's inset", async () => {
|
|
447
447
|
await openActionMenu();
|
|
448
448
|
|
|
449
449
|
const rowRadius = [...items()[0]!.classList].find((c) => c.startsWith("rounded-"))!;
|
|
450
|
-
expect([...popup()!.classList]).
|
|
451
|
-
expect(compileStudioCss([rowRadius])).toMatch(
|
|
450
|
+
expect([...popup()!.classList]).toEqual(expect.arrayContaining(["rounded-lg", "p-1"]));
|
|
451
|
+
expect(compileStudioCss([rowRadius])).toMatch(
|
|
452
|
+
/border-radius: calc\(var\(--radius-lg\) - 4px\)/,
|
|
453
|
+
);
|
|
452
454
|
});
|
|
453
455
|
});
|
|
454
456
|
|
|
@@ -71,8 +71,8 @@ export const POPUP_LAYER = "z-200";
|
|
|
71
71
|
const menuPopup = cn(popupSurface, "min-w-36 p-1 shadow-menu");
|
|
72
72
|
|
|
73
73
|
/** One row. `data-highlighted` is set by keyboard and pointer alike, so the seen row is the Enter row. */
|
|
74
|
-
const
|
|
75
|
-
"flex cursor-default select-none items-center justify-between gap-6 rounded-[calc(var(--radius-lg)
|
|
74
|
+
export const menuItemBase = cn(
|
|
75
|
+
"flex cursor-default select-none items-center justify-between gap-6 rounded-[calc(var(--radius-lg)-4px)] px-2 py-1.5",
|
|
76
76
|
"text-step-11 whitespace-nowrap text-text-1",
|
|
77
77
|
"outline-hidden transition-colors ease-out-quint duration-hover",
|
|
78
78
|
"data-[highlighted]:bg-hover data-[highlighted]:text-text-0",
|
|
@@ -210,7 +210,10 @@ interface MenuItemProps extends StyledProps<typeof BaseMenu.Item> {
|
|
|
210
210
|
/** One action. `disabled` items are skipped by the arrow keys, not just dimmed. */
|
|
211
211
|
export function MenuItem({ shortcut, tone, className, children, ...props }: MenuItemProps) {
|
|
212
212
|
return (
|
|
213
|
-
<BaseMenu.Item
|
|
213
|
+
<BaseMenu.Item
|
|
214
|
+
className={cn(menuItemBase, tone === "danger" && itemDanger, className)}
|
|
215
|
+
{...props}
|
|
216
|
+
>
|
|
214
217
|
<span className="truncate">{children}</span>
|
|
215
218
|
{shortcut ? <MenuShortcut>{shortcut}</MenuShortcut> : null}
|
|
216
219
|
</BaseMenu.Item>
|
|
@@ -229,7 +232,7 @@ interface MenuRadioItemProps extends StyledProps<typeof BaseMenu.RadioItem> {
|
|
|
229
232
|
/** One choice in a `MenuRadioGroup`. The dot renders only while it is checked. */
|
|
230
233
|
export function MenuRadioItem({ className, children, ...props }: MenuRadioItemProps) {
|
|
231
234
|
return (
|
|
232
|
-
<BaseMenu.RadioItem className={cn(
|
|
235
|
+
<BaseMenu.RadioItem className={cn(menuItemBase, className)} {...props}>
|
|
233
236
|
<span className="truncate">{children}</span>
|
|
234
237
|
{/* Fixed box so a checked and an unchecked row keep the same width. */}
|
|
235
238
|
<span className="flex size-3 shrink-0 items-center justify-center">
|
|
@@ -246,7 +249,7 @@ export function MenuCheckboxItem({
|
|
|
246
249
|
...props
|
|
247
250
|
}: StyledProps<typeof BaseMenu.CheckboxItem>) {
|
|
248
251
|
return (
|
|
249
|
-
<BaseMenu.CheckboxItem className={cn(
|
|
252
|
+
<BaseMenu.CheckboxItem className={cn(menuItemBase, className)} {...props}>
|
|
250
253
|
<span className="truncate">{children}</span>
|
|
251
254
|
<span className="flex size-3 shrink-0 items-center justify-center text-accent-ink">
|
|
252
255
|
<BaseMenu.CheckboxItemIndicator>✓</BaseMenu.CheckboxItemIndicator>
|
|
@@ -17,7 +17,7 @@ import { NumberField } from "./NumberField";
|
|
|
17
17
|
import { Select } from "./Select";
|
|
18
18
|
import { Slider } from "./Slider";
|
|
19
19
|
import { Toggle } from "./Toggle";
|
|
20
|
-
import { isTypingTarget } from "
|
|
20
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
21
21
|
import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts";
|
|
22
22
|
import { __resetDesignInputThrottle, trackDesignInput } from "../../utils/designInputTracking";
|
|
23
23
|
import { cleanupMounted, mountHost as render } from "./mountHost.testHelpers";
|
|
@@ -3,7 +3,7 @@ import { usePlayerStore } from "../player";
|
|
|
3
3
|
import type { TimelineElement } from "../player";
|
|
4
4
|
import type { DomEditSelection } from "../components/editor/domEditing";
|
|
5
5
|
import { useDockLayoutStore } from "../components/dock/dockLayoutStore";
|
|
6
|
-
import { isTypingTarget, ownsPlainKeys } from "
|
|
6
|
+
import { isTypingTarget, ownsPlainKeys } from "@hyperframes/core/typing-target";
|
|
7
7
|
import { isEditableTarget } from "../utils/timelineDiscovery";
|
|
8
8
|
import { shouldIgnoreHistoryShortcut } from "../utils/studioHelpers";
|
|
9
9
|
import { canSplitElement } from "../utils/timelineElementSplit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePlayerStore } from "../player";
|
|
2
2
|
import type { TimelineEditCallbacks } from "../player/components/timelineCallbacks";
|
|
3
3
|
import { resolveLinkMenuItems } from "../player/components/clipMenuLinkItems";
|
|
4
|
-
import { isTypingTarget } from "
|
|
4
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
5
5
|
import { keyHint, matchesKey } from "../player/components/studioShortcuts";
|
|
6
6
|
|
|
7
7
|
export interface LinkShortcutCallbacks {
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
type HfAutomationLane,
|
|
32
32
|
} from "@hyperframes/core/audio-automation";
|
|
33
33
|
import { clampNumber } from "../utils/studioHelpers";
|
|
34
|
-
import { isTypingTarget } from "
|
|
34
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
35
35
|
import { matchesKey } from "../player/components/studioShortcuts";
|
|
36
36
|
import type { AutomationSelection } from "../player/store/automationSelectionSlice";
|
|
37
37
|
import type {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useCallback } from "react";
|
|
2
2
|
import { matchesKey } from "../player/components/studioShortcuts";
|
|
3
|
-
import { isTypingTarget } from "
|
|
3
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
4
4
|
|
|
5
5
|
interface KeyframeKeyboardOptions {
|
|
6
6
|
enabled: boolean;
|
package/src/index.ts
CHANGED
|
@@ -14,8 +14,8 @@ export {
|
|
|
14
14
|
studioKeyClash,
|
|
15
15
|
useStudioKeys,
|
|
16
16
|
} from "./player/components/studioShortcuts";
|
|
17
|
-
export { formatCombo, matchCombo, parseCombo } from "
|
|
18
|
-
export type { Combo } from "
|
|
17
|
+
export { formatCombo, matchCombo, parseCombo } from "@hyperframes/core/key-combo";
|
|
18
|
+
export type { Combo } from "@hyperframes/core/key-combo";
|
|
19
19
|
export type { StudioKeyAction, StudioKeys } from "./player/components/studioShortcuts";
|
|
20
20
|
export { ShortcutsButton } from "./player/components/ShortcutsPanel";
|
|
21
21
|
export { dispatchLinkShortcut } from "./hooks/linkShortcuts";
|
package/src/keys.test.ts
CHANGED
|
@@ -31,15 +31,13 @@ function importGraph(entry: string): { files: string[]; packages: string[] } {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
describe("@hyperframes/studio/keys", () => {
|
|
34
|
-
it("imports only the key helpers:
|
|
34
|
+
it("imports only the key helpers: core's import-free matcher and no editor module", () => {
|
|
35
35
|
expect(importGraph("keys.ts")).toEqual({
|
|
36
|
-
files: [
|
|
37
|
-
|
|
38
|
-
"player/components/studioCombo.ts",
|
|
39
|
-
"player/components/studioKeyDefaults.ts",
|
|
40
|
-
],
|
|
41
|
-
packages: [],
|
|
36
|
+
files: ["keys.ts", "player/components/studioKeyDefaults.ts"],
|
|
37
|
+
packages: ["@hyperframes/core/key-combo"],
|
|
42
38
|
});
|
|
39
|
+
const matcher = readFileSync(join(src, "../../core/src/keyCombo.ts"), "utf8");
|
|
40
|
+
expect(ts.preProcessFile(matcher).importedFiles).toEqual([]);
|
|
43
41
|
});
|
|
44
42
|
|
|
45
43
|
it("is a published subpath sharing the defaults the root entry exports", async () => {
|
package/src/keys.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
matchCombo,
|
|
3
|
-
parseCombo,
|
|
4
|
-
type Combo,
|
|
5
|
-
type ComboEvent,
|
|
6
|
-
} from "./player/components/studioCombo";
|
|
1
|
+
export { matchCombo, parseCombo, type Combo, type ComboEvent } from "@hyperframes/core/key-combo";
|
|
7
2
|
export {
|
|
8
3
|
DEFAULT_STUDIO_KEYS,
|
|
9
4
|
type StudioKeyAction,
|
|
@@ -5,7 +5,7 @@ import { flatActive, flatIdle } from "../../components/timelineToolbarStyles";
|
|
|
5
5
|
import { usePlayerStore } from "../store/playerStore";
|
|
6
6
|
import { useCompositionFps } from "../../utils/linkedClipPreferences";
|
|
7
7
|
import { matchesKey, useShortcutSections, type ShortcutSection } from "./studioShortcuts";
|
|
8
|
-
import { isTypingTarget } from "
|
|
8
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
9
9
|
|
|
10
10
|
interface ShortcutsPanelProps {
|
|
11
11
|
disabled: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { formatCombo, matchCombo, parseCombo } from "
|
|
3
|
+
import { formatCombo, matchCombo, parseCombo } from "@hyperframes/core/key-combo";
|
|
4
4
|
import {
|
|
5
5
|
getStudioKey,
|
|
6
6
|
getStudioKeys,
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* is active and the user is navigating caption segments).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import type { ComboEvent } from "
|
|
9
|
+
import { shouldIgnorePlaybackShortcutTarget } from "@hyperframes/core/typing-target";
|
|
10
|
+
import type { ComboEvent } from "@hyperframes/core/key-combo";
|
|
11
11
|
import { matchesKey } from "../components/studioShortcuts";
|
|
12
12
|
import { usePlayerStore } from "../store/playerStore";
|
|
13
13
|
|
|
@@ -18,32 +18,7 @@ const FRAME_STEP_ACTIONS = [
|
|
|
18
18
|
"frameForwardTen",
|
|
19
19
|
] as const;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
"button",
|
|
23
|
-
"a[href]",
|
|
24
|
-
"[role='button']",
|
|
25
|
-
"[role='checkbox']",
|
|
26
|
-
"[role='menuitem']",
|
|
27
|
-
// Base UI's menu radio item is a `<div>`, so `button` above no longer catches it.
|
|
28
|
-
"[role='menuitemradio']",
|
|
29
|
-
"[role='radio']",
|
|
30
|
-
"[role='spinbutton']",
|
|
31
|
-
].join(",");
|
|
32
|
-
|
|
33
|
-
export function shouldIgnorePlaybackShortcutTarget(target: EventTarget | null): boolean {
|
|
34
|
-
// Anything the user is typing into owns its keys outright, editable elements
|
|
35
|
-
// included: a letter claimed here never reaches the text. So does a native player.
|
|
36
|
-
if (ownsPlainKeys(target)) return true;
|
|
37
|
-
if (!target || typeof target !== "object") return false;
|
|
38
|
-
const candidate = target as { closest?: unknown };
|
|
39
|
-
if (typeof candidate.closest !== "function") return false;
|
|
40
|
-
return (
|
|
41
|
-
(candidate.closest as (selector: string) => Element | null).call(
|
|
42
|
-
target,
|
|
43
|
-
PLAYBACK_SHORTCUT_IGNORED_SELECTOR,
|
|
44
|
-
) !== null
|
|
45
|
-
);
|
|
46
|
-
}
|
|
21
|
+
export { shouldIgnorePlaybackShortcutTarget };
|
|
47
22
|
|
|
48
23
|
const MODAL_DIALOG_SELECTOR = "[role=dialog][aria-modal=true]";
|
|
49
24
|
|
package/src/ui.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildProjectApiPath } from "./projectRouting";
|
|
2
|
-
import { isTypingTarget } from "
|
|
2
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
3
3
|
import type { TimelineElement } from "../player/store/playerStore";
|
|
4
4
|
import type { DomEditSelection } from "../components/editor/domEditing";
|
|
5
5
|
import type { TimelineAssetKind } from "./timelineAssetDrop";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StudioFileConflictError, type StudioSaveDrainResult } from "./studioSaveDiagnostics";
|
|
2
|
-
import { isTypingTarget } from "
|
|
2
|
+
import { isTypingTarget } from "@hyperframes/core/typing-target";
|
|
3
3
|
|
|
4
4
|
const STUDIO_FLUSH_PENDING_EDITS_EVENT = "hf-studio-flush-pending-edits";
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Compatibility name for downstream imports. The typing decision itself has
|
|
2
2
|
// one owner; new Studio callers import `isTypingTarget` directly.
|
|
3
|
-
export { isTypingTarget as isEditableTarget } from "
|
|
3
|
+
export { isTypingTarget as isEditableTarget } from "@hyperframes/core/typing-target";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
|
|
3
3
|
import { afterEach, describe, expect, it } from "vitest";
|
|
4
|
-
import { isTypingTarget, ownsPlainKeys } from "
|
|
4
|
+
import { isTypingTarget, ownsPlainKeys } from "@hyperframes/core/typing-target";
|
|
5
5
|
import { isEditableTarget } from "./timelineDiscovery";
|
|
6
6
|
|
|
7
7
|
afterEach(() => {
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
/**
|
|
3
3
|
* Loads the REAL `@mcp-b/global` through Studio's loader, inside a page that is
|
|
4
|
-
* framed by another site, and checks that neither of the package's
|
|
5
|
-
* transports answers anyone but Studio's own page.
|
|
4
|
+
* framed by another site, and checks that neither of the package's MCP
|
|
5
|
+
* message transports answers anyone but Studio's own page. The W3C polyfill's
|
|
6
|
+
* frame protocol is not exercised here: the fake framer is not `window.top`.
|
|
6
7
|
*/
|
|
7
8
|
import { afterAll, expect, it, vi } from "vitest";
|
|
8
9
|
|
|
9
10
|
vi.mock("../telemetry/client", () => ({ trackEvent: vi.fn() }));
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
// A top-level window: the polyfill walks `parent` until it reaches itself.
|
|
13
|
+
const framer = {
|
|
14
|
+
postMessage: vi.fn(),
|
|
15
|
+
get parent(): object {
|
|
16
|
+
return framer;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
12
19
|
const ownParent = Object.getOwnPropertyDescriptor(window, "parent");
|
|
13
20
|
afterAll(() => {
|
|
14
21
|
if (ownParent) Object.defineProperty(window, "parent", ownParent);
|
|
15
22
|
else Reflect.deleteProperty(window, "parent");
|
|
23
|
+
Reflect.deleteProperty(window, "isSecureContext");
|
|
16
24
|
});
|
|
17
25
|
|
|
18
26
|
const settle = () => new Promise((resolve) => setTimeout(resolve, 20));
|
|
19
27
|
|
|
20
28
|
it("answers no MCP client but Studio's own page when another site frames Studio", async () => {
|
|
21
29
|
Object.defineProperty(window, "parent", { value: framer, configurable: true });
|
|
30
|
+
// jsdom leaves this undefined and the polyfill installs only in a secure context.
|
|
31
|
+
Object.defineProperty(window, "isSecureContext", { value: true, configurable: true });
|
|
22
32
|
const ownMessages = vi.spyOn(window, "postMessage");
|
|
23
33
|
const { loadModelContextPolyfill } = await import("./polyfill");
|
|
24
34
|
|
package/src/webmcp/types.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* Only the surface Studio registers against is declared. `getTools` and
|
|
15
15
|
* `executeTool` are the consumer side; Studio registers, it does not call.
|
|
16
16
|
*
|
|
17
|
-
* These stay hand-written rather than imported from
|
|
18
|
-
*
|
|
17
|
+
* These stay hand-written rather than imported from `webmcp-types`, which
|
|
18
|
+
* the polyfill pulls in. That package's `registerTool` is overloaded to
|
|
19
19
|
* infer argument types from a literal `inputSchema`, which is useful when you
|
|
20
20
|
* register one tool inline and actively hostile when you register a uniform
|
|
21
21
|
* list of them, as `registerStudioTools` does. Narrower is the safe operation
|
|
@@ -59,7 +59,7 @@ export interface ModelContextTool {
|
|
|
59
59
|
* instead. See `toolResult.ts`.
|
|
60
60
|
*
|
|
61
61
|
* `options` is optional here although the spec always passes it: the
|
|
62
|
-
* `@mcp-b/global` polyfill
|
|
62
|
+
* `@mcp-b/global` polyfill before 6.0 called `execute(input)` with no
|
|
63
63
|
* second argument, so a Studio handler must not depend on receiving one.
|
|
64
64
|
*/
|
|
65
65
|
execute: (input: object, options?: ToolExecuteCallbackOptions) => Promise<unknown>;
|