@hyperframes/studio 0.9.52 → 0.9.54

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.
Files changed (70) hide show
  1. package/dist/assets/{hyperframes-player-D7LhzIg1.js → hyperframes-player-Oju91F6x.js} +2 -2
  2. package/dist/assets/{index-D3WxJaqm.js → index-B0VEzzD2.js} +180 -180
  3. package/dist/assets/index-Dv67Vrl6.js +74 -0
  4. package/dist/assets/{index-CQ7o0CBU.js → index-XEm_N45R.js} +1 -1
  5. package/dist/assets/{pausedVideoDecoder-BVUmBgn0.js → pausedVideoDecoder-p6zibxVM.js} +1 -1
  6. package/dist/{chunk-F6EHWNZU.js → chunk-K3IOYISK.js} +121 -94
  7. package/dist/{chunk-VHV2ZDKY.js → chunk-OOGQ5KCC.js} +7 -0
  8. package/dist/{chunk-GVW7AU57.js → chunk-UM4CLD4M.js} +1 -1
  9. package/dist/chunk-USW3YBOG.js +70 -0
  10. package/dist/{domEditingLayers-SA5KLSSS.js → domEditingLayers-IHYA42AJ.js} +2 -2
  11. package/dist/index.d.ts +14 -7
  12. package/dist/index.html +1 -1
  13. package/dist/index.js +110 -98
  14. package/dist/keys.d.ts +72 -1
  15. package/dist/keys.js +5 -4
  16. package/dist/player.d.ts +1 -0
  17. package/dist/player.js +2 -2
  18. package/package.json +9 -9
  19. package/src/captions/keyboard.ts +1 -1
  20. package/src/components/RightPanelTabs.test.tsx +1 -1
  21. package/src/components/StudioHeader.dom.test.tsx +1 -1
  22. package/src/components/TimelineHistoryButtons.dom.test.tsx +1 -1
  23. package/src/components/TimelineToolbar.tsx +1 -1
  24. package/src/components/editor/SnapToolbar.tsx +1 -1
  25. package/src/components/editor/gsapLivePreview.test.ts +19 -0
  26. package/src/components/editor/gsapLivePreview.ts +2 -0
  27. package/src/components/editor/manualEditingAvailability.ts +7 -0
  28. package/src/components/editor/useDomEditNudge.ts +1 -1
  29. package/src/components/nle/NLEPreview.test.ts +25 -0
  30. package/src/components/nle/NLEPreview.tsx +5 -0
  31. package/src/components/nle/PreviewPane.tsx +2 -0
  32. package/src/components/panels/SlideshowPanel.tsx +1 -1
  33. package/src/components/renders/RenderQueue.test.tsx +1 -1
  34. package/src/components/sidebar/CompositionsTab.tsx +4 -8
  35. package/src/components/ui/Button.test.tsx +1 -1
  36. package/src/components/ui/Menu.test.tsx +1 -1
  37. package/src/components/ui/valueControls.test.tsx +1 -1
  38. package/src/hooks/appHotkeysDispatch.ts +1 -1
  39. package/src/hooks/gsapParsedTween.test.ts +19 -0
  40. package/src/hooks/gsapParsedTween.ts +3 -1
  41. package/src/hooks/linkShortcuts.ts +1 -1
  42. package/src/hooks/useAutomationSelectionKeyboard.ts +1 -1
  43. package/src/hooks/useConsoleErrorCapture.test.tsx +69 -1
  44. package/src/hooks/useConsoleErrorCapture.ts +47 -11
  45. package/src/hooks/useKeyframeKeyboard.ts +1 -1
  46. package/src/index.ts +3 -2
  47. package/src/keys.test.ts +5 -7
  48. package/src/keys.ts +1 -6
  49. package/src/player/components/Player.test.ts +49 -0
  50. package/src/player/components/Player.tsx +13 -4
  51. package/src/player/components/ShortcutsPanel.tsx +1 -1
  52. package/src/player/components/studioCombo.test.ts +1 -1
  53. package/src/player/components/studioShortcuts.ts +1 -1
  54. package/src/player/lib/frameToken.ts +20 -0
  55. package/src/player/lib/playbackShortcuts.ts +3 -28
  56. package/src/player/lib/previewChannel.ts +10 -0
  57. package/src/utils/studioHelpers.ts +1 -1
  58. package/src/utils/studioPendingEdits.ts +1 -1
  59. package/src/utils/timelineDiscovery.ts +1 -1
  60. package/src/utils/typingTarget.test.ts +1 -1
  61. package/src/webmcp/polyfill.transport.test.ts +13 -3
  62. package/src/webmcp/types.ts +3 -3
  63. package/src/webmcp/useStudioAgentTools.polyfill.test.tsx +89 -121
  64. package/src/webmcp/useStudioAgentTools.test.tsx +2 -2
  65. package/src/webmcp/useStudioAgentTools.ts +2 -3
  66. package/dist/assets/index-BX3KHhGX.js +0 -71
  67. package/dist/chunk-5ZHKYODQ.js +0 -149
  68. package/dist/keys-B163OjLN.d.ts +0 -87
  69. package/src/player/components/studioCombo.ts +0 -108
  70. package/src/utils/typingTarget.ts +0 -56
@@ -1,149 +0,0 @@
1
- // src/player/components/studioCombo.ts
2
- var NAMED = /* @__PURE__ */ new Set([
3
- "Space",
4
- "ArrowLeft",
5
- "ArrowRight",
6
- "ArrowUp",
7
- "ArrowDown",
8
- "Home",
9
- "End",
10
- "PageUp",
11
- "PageDown",
12
- "Delete",
13
- "Backspace",
14
- "Escape",
15
- "Enter",
16
- "Tab"
17
- ]);
18
- var SYMBOL = {
19
- ArrowLeft: "\u2190",
20
- ArrowRight: "\u2192",
21
- ArrowUp: "\u2191",
22
- ArrowDown: "\u2193",
23
- Delete: "Del",
24
- Backspace: "\u232B",
25
- Escape: "Esc"
26
- };
27
- var MODIFIERS = /* @__PURE__ */ new Set(["mod", "cmd", "ctrl", "shift", "alt"]);
28
- function parseCombo(text) {
29
- const split = text.length > 1 ? text.slice(0, -1).lastIndexOf("+") : -1;
30
- const tokens = split < 0 ? [] : text.slice(0, split).split("+").map((t) => t.toLowerCase());
31
- const key = text.slice(split + 1);
32
- const named = NAMED.has(key);
33
- const symbol = !named && !/^[A-Za-z]$/.test(key);
34
- if (tokens.some((t) => !MODIFIERS.has(t)) || !named && [...key].length !== 1) return null;
35
- if (symbol && tokens.includes("shift")) return null;
36
- const combo = {
37
- mod: tokens.includes("mod"),
38
- meta: tokens.includes("cmd"),
39
- ctrl: tokens.includes("ctrl"),
40
- shift: tokens.includes("shift"),
41
- alt: tokens.includes("alt"),
42
- key: named ? key : key.toLowerCase(),
43
- named
44
- };
45
- return combo.alt && (combo.ctrl || combo.mod) ? null : combo;
46
- }
47
- function comboText(c) {
48
- const mods = [
49
- c.mod && "mod",
50
- c.meta && "cmd",
51
- c.ctrl && "ctrl",
52
- c.alt && "alt",
53
- c.shift && "shift"
54
- ];
55
- return [...mods.filter(Boolean), c.key].join("+");
56
- }
57
- var namedMatches = (e, name) => e.code === name || e.key === (name === "Space" ? " " : name);
58
- function charMatches(e, c) {
59
- if (e.key.toLowerCase() === c.key) return true;
60
- const code = /^[0-9]$/.test(c.key) ? `Digit${c.key}` : `Key${c.key.toUpperCase()}`;
61
- return e.altKey && /^[a-z0-9]$/.test(c.key) && e.code === code;
62
- }
63
- function matchCombo(e, c) {
64
- const symbol = !c.named && !/^[a-z]$/.test(c.key);
65
- if (!symbol && !!e.shiftKey !== c.shift || !!e.altKey !== c.alt) return false;
66
- const modsOk = c.mod ? e.metaKey || e.ctrlKey : !!e.metaKey === c.meta && !!e.ctrlKey === c.ctrl;
67
- return modsOk && (c.named ? namedMatches(e, c.key) : charMatches(e, c));
68
- }
69
- function formatCombo(c) {
70
- const mods = `${c.ctrl ? "\u2303" : ""}${c.alt ? "\u2325" : ""}${c.mod || c.meta ? "\u2318" : ""}${c.shift ? "\u21E7" : ""}`;
71
- return mods + (SYMBOL[c.key] ?? (c.named ? c.key : c.key.toUpperCase()));
72
- }
73
- var comboClashKey = (c) => [c.mod || c.meta || c.ctrl, c.alt, c.shift, c.key].join("|");
74
-
75
- // src/player/components/studioKeyDefaults.ts
76
- var DEFAULT_STUDIO_KEYS = {
77
- fullscreen: "f",
78
- split: "s",
79
- record: "r",
80
- addKeyframe: "k",
81
- audioGain: "g",
82
- zoomSelection: "z",
83
- mute: "m",
84
- pause: "k",
85
- shuttleBack: "j",
86
- shuttleForward: "l",
87
- inPoint: "i",
88
- outPoint: "o",
89
- seekToIn: "a",
90
- seekToOut: "e",
91
- selectTool: "v",
92
- razorTool: "b",
93
- selectLeftward: "[",
94
- selectRightward: "]",
95
- exitRazor: "a",
96
- snap: "s",
97
- grid: "g",
98
- timelineSnap: "n",
99
- shortcuts: "?",
100
- playPause: "Space",
101
- frameBack: "ArrowLeft",
102
- frameForward: "ArrowRight",
103
- frameBackTen: "shift+ArrowLeft",
104
- frameForwardTen: "shift+ArrowRight",
105
- loop: "shift+l",
106
- clearInPoint: "shift+i",
107
- clearOutPoint: "shift+o",
108
- undo: "mod+z",
109
- redo: "mod+shift+z",
110
- redoAlt: "ctrl+y",
111
- tabCompositions: "mod+1",
112
- tabAssets: "mod+2",
113
- group: "mod+g",
114
- ungroup: "mod+shift+g",
115
- copy: "mod+c",
116
- paste: "mod+v",
117
- cut: "mod+x",
118
- duplicate: "mod+d",
119
- linkToggle: "mod+l",
120
- detachAudio: "alt+shift+d",
121
- deleteLinked: "alt+Backspace",
122
- deleteLinkedAlt: "alt+Delete",
123
- deleteSelected: "Delete",
124
- deleteSelectedAlt: "Backspace",
125
- resetKeyframes: "Backspace",
126
- nudgeLeft: "ArrowLeft",
127
- nudgeRight: "ArrowRight",
128
- nudgeUp: "ArrowUp",
129
- nudgeDown: "ArrowDown",
130
- nudgeLeftTen: "shift+ArrowLeft",
131
- nudgeRightTen: "shift+ArrowRight",
132
- nudgeUpTen: "shift+ArrowUp",
133
- nudgeDownTen: "shift+ArrowDown",
134
- captionSelectAll: "mod+a",
135
- pickupClip: "Space",
136
- pickupUp: "ArrowUp",
137
- pickupDown: "ArrowDown",
138
- pickupDrop: "Enter",
139
- cancel: "Escape"
140
- };
141
-
142
- export {
143
- parseCombo,
144
- comboText,
145
- matchCombo,
146
- formatCombo,
147
- comboClashKey,
148
- DEFAULT_STUDIO_KEYS
149
- };
@@ -1,87 +0,0 @@
1
- interface Combo {
2
- mod: boolean;
3
- meta: boolean;
4
- ctrl: boolean;
5
- shift: boolean;
6
- alt: boolean;
7
- key: string;
8
- named: boolean;
9
- }
10
- /** "mod+shift+z", "Space", "b": mod is Cmd or Ctrl; Ctrl+Alt is refused because Windows sends AltGr as Ctrl+Alt. */
11
- declare function parseCombo(text: string): Combo | null;
12
- type ComboEvent = Pick<KeyboardEvent, "key" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey"> & {
13
- code?: string;
14
- };
15
- declare function matchCombo(e: ComboEvent, c: Combo): boolean;
16
- declare function formatCombo(c: Combo): string;
17
-
18
- /** Every single-character bare key Studio answers, by action. */
19
- declare const DEFAULT_STUDIO_KEYS: {
20
- fullscreen: string;
21
- split: string;
22
- record: string;
23
- addKeyframe: string;
24
- audioGain: string;
25
- zoomSelection: string;
26
- mute: string;
27
- pause: string;
28
- shuttleBack: string;
29
- shuttleForward: string;
30
- inPoint: string;
31
- outPoint: string;
32
- seekToIn: string;
33
- seekToOut: string;
34
- selectTool: string;
35
- razorTool: string;
36
- selectLeftward: string;
37
- selectRightward: string;
38
- exitRazor: string;
39
- snap: string;
40
- grid: string;
41
- timelineSnap: string;
42
- shortcuts: string;
43
- playPause: string;
44
- frameBack: string;
45
- frameForward: string;
46
- frameBackTen: string;
47
- frameForwardTen: string;
48
- loop: string;
49
- clearInPoint: string;
50
- clearOutPoint: string;
51
- undo: string;
52
- redo: string;
53
- redoAlt: string;
54
- tabCompositions: string;
55
- tabAssets: string;
56
- group: string;
57
- ungroup: string;
58
- copy: string;
59
- paste: string;
60
- cut: string;
61
- duplicate: string;
62
- linkToggle: string;
63
- detachAudio: string;
64
- deleteLinked: string;
65
- deleteLinkedAlt: string;
66
- deleteSelected: string;
67
- deleteSelectedAlt: string;
68
- resetKeyframes: string;
69
- nudgeLeft: string;
70
- nudgeRight: string;
71
- nudgeUp: string;
72
- nudgeDown: string;
73
- nudgeLeftTen: string;
74
- nudgeRightTen: string;
75
- nudgeUpTen: string;
76
- nudgeDownTen: string;
77
- captionSelectAll: string;
78
- pickupClip: string;
79
- pickupUp: string;
80
- pickupDown: string;
81
- pickupDrop: string;
82
- cancel: string;
83
- };
84
- type StudioKeyAction = keyof typeof DEFAULT_STUDIO_KEYS;
85
- type StudioKeys = Readonly<Record<StudioKeyAction, string>>;
86
-
87
- export { type Combo as C, DEFAULT_STUDIO_KEYS as D, type StudioKeys as S, type StudioKeyAction as a, type ComboEvent as b, formatCombo as f, matchCombo as m, parseCombo as p };
@@ -1,108 +0,0 @@
1
- export interface Combo {
2
- mod: boolean;
3
- meta: boolean;
4
- ctrl: boolean;
5
- shift: boolean;
6
- alt: boolean;
7
- key: string;
8
- named: boolean;
9
- }
10
-
11
- const NAMED = new Set([
12
- "Space",
13
- "ArrowLeft",
14
- "ArrowRight",
15
- "ArrowUp",
16
- "ArrowDown",
17
- "Home",
18
- "End",
19
- "PageUp",
20
- "PageDown",
21
- "Delete",
22
- "Backspace",
23
- "Escape",
24
- "Enter",
25
- "Tab",
26
- ]);
27
- const SYMBOL: Record<string, string> = {
28
- ArrowLeft: "←",
29
- ArrowRight: "→",
30
- ArrowUp: "↑",
31
- ArrowDown: "↓",
32
- Delete: "Del",
33
- Backspace: "⌫",
34
- Escape: "Esc",
35
- };
36
- const MODIFIERS = new Set(["mod", "cmd", "ctrl", "shift", "alt"]);
37
-
38
- /** "mod+shift+z", "Space", "b": mod is Cmd or Ctrl; Ctrl+Alt is refused because Windows sends AltGr as Ctrl+Alt. */
39
- export function parseCombo(text: string): Combo | null {
40
- const split = text.length > 1 ? text.slice(0, -1).lastIndexOf("+") : -1;
41
- const tokens =
42
- split < 0
43
- ? []
44
- : text
45
- .slice(0, split)
46
- .split("+")
47
- .map((t) => t.toLowerCase());
48
- const key = text.slice(split + 1);
49
- const named = NAMED.has(key);
50
- const symbol = !named && !/^[A-Za-z]$/.test(key);
51
- if (tokens.some((t) => !MODIFIERS.has(t)) || (!named && [...key].length !== 1)) return null;
52
- if (symbol && tokens.includes("shift")) return null;
53
- const combo = {
54
- mod: tokens.includes("mod"),
55
- meta: tokens.includes("cmd"),
56
- ctrl: tokens.includes("ctrl"),
57
- shift: tokens.includes("shift"),
58
- alt: tokens.includes("alt"),
59
- key: named ? key : key.toLowerCase(),
60
- named,
61
- };
62
- return combo.alt && (combo.ctrl || combo.mod) ? null : combo;
63
- }
64
-
65
- /** The one string a combo is stored and compared as. */
66
- export function comboText(c: Combo): string {
67
- const mods = [
68
- c.mod && "mod",
69
- c.meta && "cmd",
70
- c.ctrl && "ctrl",
71
- c.alt && "alt",
72
- c.shift && "shift",
73
- ];
74
- return [...mods.filter(Boolean), c.key].join("+");
75
- }
76
-
77
- const namedMatches = (e: ComboEvent, name: string) =>
78
- e.code === name || e.key === (name === "Space" ? " " : name);
79
-
80
- function charMatches(e: ComboEvent, c: Combo): boolean {
81
- if (e.key.toLowerCase() === c.key) return true;
82
- // Option rewrites e.key on macOS (Option+D is "∂"), so fall back to the physical key.
83
- const code = /^[0-9]$/.test(c.key) ? `Digit${c.key}` : `Key${c.key.toUpperCase()}`;
84
- return e.altKey && /^[a-z0-9]$/.test(c.key) && e.code === code;
85
- }
86
-
87
- export type ComboEvent = Pick<
88
- KeyboardEvent,
89
- "key" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey"
90
- > & {
91
- code?: string;
92
- };
93
-
94
- export function matchCombo(e: ComboEvent, c: Combo): boolean {
95
- const symbol = !c.named && !/^[a-z]$/.test(c.key);
96
- if ((!symbol && !!e.shiftKey !== c.shift) || !!e.altKey !== c.alt) return false;
97
- const modsOk = c.mod ? e.metaKey || e.ctrlKey : !!e.metaKey === c.meta && !!e.ctrlKey === c.ctrl;
98
- return modsOk && (c.named ? namedMatches(e, c.key) : charMatches(e, c));
99
- }
100
-
101
- export function formatCombo(c: Combo): string {
102
- const mods = `${c.ctrl ? "⌃" : ""}${c.alt ? "⌥" : ""}${c.mod || c.meta ? "⌘" : ""}${c.shift ? "⇧" : ""}`;
103
- return mods + (SYMBOL[c.key] ?? (c.named ? c.key : c.key.toUpperCase()));
104
- }
105
-
106
- /** Two combos clash when one press could satisfy both; Cmd and Ctrl both count as mod. */
107
- export const comboClashKey = (c: Combo) =>
108
- [c.mod || c.meta || c.ctrl, c.alt, c.shift, c.key].join("|");
@@ -1,56 +0,0 @@
1
- /**
2
- * Whether a keystroke is going somewhere the user is typing.
3
- *
4
- * Every keyboard shortcut in Studio has to ask this before claiming a key, and
5
- * they were each asking it slightly differently. The version that matched
6
- * `[contenteditable='true']` missed `contenteditable="plaintext-only"`, which
7
- * is what inline text editing uses, so the playback shortcuts kept claiming
8
- * letters out of it: `a` seeked to the in-point and `e` to the out-point,
9
- * `preventDefault` and all, and the character never reached the text.
10
- *
11
- * `isContentEditable` is the property to ask, not the attribute to match: it is
12
- * true for every editable value and for an element made editable by an
13
- * ancestor, which an attribute selector on the target alone cannot see.
14
- * The wider input gate is deliberate too: checkboxes and readonly fields own
15
- * Space and arrow keys even when they do not accept text.
16
- */
17
- export function isTypingTarget(target: EventTarget | null): boolean {
18
- const element = asElement(target);
19
- if (!element) return false;
20
- if (element.isContentEditable) return true;
21
- return element.closest(TYPING_SELECTOR) !== null;
22
- }
23
-
24
- /** Plain keys (arrows, Space, Delete) also belong to a focused slider or player; Cmd shortcuts still do not. */
25
- export function ownsPlainKeys(target: EventTarget | null): boolean {
26
- return isTypingTarget(target) || asElement(target)?.closest(KEY_OWNING_CONTROLS) != null;
27
- }
28
-
29
- // A slider steps and a native player seeks and plays with these keys themselves.
30
- const KEY_OWNING_CONTROLS = "[role='slider'],video[controls],audio[controls]";
31
-
32
- /**
33
- * Things a keystroke belongs to rather than to a shortcut. `contenteditable` is
34
- * matched by value as well, for a host whose own property is not yet true.
35
- */
36
- const TYPING_SELECTOR = [
37
- "input",
38
- "textarea",
39
- "select",
40
- "[contenteditable]:not([contenteditable='false'])",
41
- "[role='textbox']",
42
- "[role='searchbox']",
43
- "[role='combobox']",
44
- // A switch is a button in the DOM, but the native checkbox it replaces was an
45
- // `input` and matched above. Without this row the shared Toggle would let a
46
- // global shortcut claim Space instead of flipping the control (KTD13).
47
- "[role='switch']",
48
- "[role='dialog'][aria-modal='true']",
49
- ".cm-editor",
50
- ].join(",");
51
-
52
- function asElement(target: EventTarget | null): HTMLElement | null {
53
- if (!target || typeof target !== "object") return null;
54
- const candidate = target as { closest?: unknown; isContentEditable?: unknown };
55
- return typeof candidate.closest === "function" ? (target as HTMLElement) : null;
56
- }