@hyperframes/studio 0.9.0 → 0.9.2
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-z-8ElsHL.js → hyperframes-player-ZrazkISK.js} +1 -1
- package/dist/assets/{index-CBZs_Rm3.js → index-DVDkDAQX.js} +1 -1
- package/dist/assets/{index-M-AHqD2Z.js → index-ZDVj-MKT.js} +5 -5
- package/dist/index.d.ts +19 -1
- package/dist/index.html +1 -1
- package/dist/index.js +13 -0
- package/package.json +8 -8
- package/src/index.ts +3 -0
- package/src/player/components/studioCombo.test.ts +21 -1
- package/src/player/components/studioShortcuts.ts +14 -0
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,23 @@ import '@base-ui/react/context-menu';
|
|
|
23
23
|
import '@base-ui/react/menu';
|
|
24
24
|
import '@base-ui/react/popover';
|
|
25
25
|
|
|
26
|
+
interface Combo {
|
|
27
|
+
mod: boolean;
|
|
28
|
+
meta: boolean;
|
|
29
|
+
ctrl: boolean;
|
|
30
|
+
shift: boolean;
|
|
31
|
+
alt: boolean;
|
|
32
|
+
key: string;
|
|
33
|
+
named: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** "mod+shift+z", "Space", "b": mod is Cmd or Ctrl; Ctrl+Alt is refused because Windows sends AltGr as Ctrl+Alt. */
|
|
36
|
+
declare function parseCombo(text: string): Combo | null;
|
|
37
|
+
type ComboEvent = Pick<KeyboardEvent, "key" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey"> & {
|
|
38
|
+
code?: string;
|
|
39
|
+
};
|
|
40
|
+
declare function matchCombo(e: ComboEvent, c: Combo): boolean;
|
|
41
|
+
declare function formatCombo(c: Combo): string;
|
|
42
|
+
|
|
26
43
|
/** Every single-character bare key Studio answers, by action. */
|
|
27
44
|
declare const DEFAULT_STUDIO_KEYS: {
|
|
28
45
|
fullscreen: string;
|
|
@@ -90,6 +107,7 @@ declare const DEFAULT_STUDIO_KEYS: {
|
|
|
90
107
|
};
|
|
91
108
|
type StudioKeyAction = keyof typeof DEFAULT_STUDIO_KEYS;
|
|
92
109
|
type StudioKeys = Readonly<Record<StudioKeyAction, string>>;
|
|
110
|
+
declare function studioKeyClash(action: StudioKeyAction, text: string, keys?: StudioKeys): StudioKeyAction | null;
|
|
93
111
|
/** Replaces the host key map; a bad map is refused whole. null restores the defaults. */
|
|
94
112
|
declare function setStudioKeys(overrides: Partial<Record<StudioKeyAction, string>> | null): void;
|
|
95
113
|
declare const getStudioKeys: () => StudioKeys;
|
|
@@ -4450,4 +4468,4 @@ declare function buildStudioTools(depsRef: {
|
|
|
4450
4468
|
readonly current: StudioAgentToolsDeps;
|
|
4451
4469
|
}): ModelContextTool[];
|
|
4452
4470
|
|
|
4453
|
-
export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, AudioMeterStrip, type AudioMeterStripProps, AudioWaveform, type AudioWaveformProps, type BlockedTimelineEditIntent, type CanEditTimelineElement, ColorField, CompositionBreadcrumb, type CompositionDimensions, type CompositionLevel, CompositionThumbnail, ConnectedDomEditOverlay, type ConnectedDomEditOverlayProps, DEFAULT_SHORTCUT_SECTIONS, DEFAULT_STUDIO_KEYS, Dock, type DockController, type DomEditCapabilities, type DomEditCommitDeclineReason, type DomEditCommitOutcome, type DomEditGroupPathOffsetCommit, DomEditOverlay, type DomEditOverlayProps, DomEditProvider, type DomEditSelection, type DomEditZOrder, type DomGeometryCommits, type EditHistoryHandle, EditorShell, type EditorShellProps, type ExternalFileChangeBlockedState, type ExternalFileChangeCoordinatorHandle, ExternalFileConflictBanner, type FadeEdge, type FadeHandleBox, type FadeHandleClipBox, type FfmpegStatus, FileTree, GradientField, GridOverlay, ImageThumbnail, type ImageThumbnailProps, LayersPanel, type LayersPanelHost, type LinkShortcutCallbacks, type MarqueeGestures, type MarqueeGesturesDeps, MarqueeOverlay, type MarqueeOverlayProps, type Rect$1 as MarqueeRect, type ModelContextTool, NLEPreview, type PanelId, type PatchOperation, type PersistedRenderSettings, type PickedElement, type PlaybackHealth, PlayerControls, type PlayerHandle, type PlayerHandleElement, type PlayerHandleListener, type PlayerHandleTimeListener, type DomEditCompositionRect as PreviewCompositionRect, type PreviewCopies, type PreviewFacts, PreviewGuides, PreviewOverlayProvider, type PreviewOverlayProviderProps, type PreviewPromotion, type PreviewQualityChosenBy, PreviewReadOnlyProvider, type PreviewSnapPreferences, PropertyPanel, type RenderJob, RenderQueue, type RenderQueueProps, type ResolutionPreset, SNAP_THRESHOLD_PX, type ShortcutHint, type ShortcutSection, ShortcutsButton, type ShortcutsButtonProps, type SnapContext, type SnapEdge, type SnapGuide, SnapGuideOverlay, type SnapGuideOverlayProps, type SnapGuidesState, type Rect as SnapRect, type SnapResult, type SnapTarget, SnapToolbar, SourceEditor, type SpacingGuide, type StartRenderOptions, type StudioAgentToolsDeps, StudioApp, StudioFileConflictError, type StudioKeyAction, type StudioKeys, type StudioLookSnapshot, type StudioPendingEditsDrainResult, TRACK_H, type ThumbnailPriority, type ThumbnailStill, Timeline, TimelineClipMenu, type TimelineClipMenuItem, type TimelineClipRenderContext, type TimelineEditCallbacks, type TimelineEditOutcome, type TimelineEditPermission, TimelineEditPopover, TimelineEditProvider, type TimelineElement, TimelineEmptyStatePart, TimelineFrame, TimelineGapMenu, TimelineHistoryButtons, type TimelineHistoryButtonsProps, TimelineKeyframeMenu, TimelineLanes, TimelineOverlays, TimelinePane, type TimelinePaneProps, TimelinePlayhead, TimelineProvider, TimelineRazorGuide, TimelineRuler, TimelineShortcutHint, type TimelineTheme, type TimelineTimeRange$1 as TimelineTimeRange, TimelineToolbar, type TimelineToolbarProps, type TimelineTrackPadding, type TimelineZIndexReorderCommit, type ToolResult, type UseClipboardOptions, type UseDomEditSessionParams, type UseDomGeometryCommitOptions, type UseDomStyleCommitOptions, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UsePreviewPersistenceParams, type UseProjectFileWriterOptions, type UseRenderClipContentOptions, type UseThumbnailStillOptions, type UseTimelineEditingOptions, VideoThumbnail, type ZOrderAction, announcePreviewDocumentLoaded, applyPatch, buildCompositionSnapTarget, buildGridSnapEdges, buildPickerAgentContextPreview, buildPickerAgentPrompt, buildShortcutSections, buildStudioTools, cancelNewestStudioWaitingPress, collectSnapContext, collectStudioLookScene, currentTimelineRange, dispatchLinkShortcut, displayTrackOrder, extractSnapTargets, fadeHandleBoxes, findElementBlock, flushStudioPendingEdits, formatTime, getPersistedRenderSettings, getStudioKeys, liveTime, mergeStyleIntoTag, openAudioGainDialog, parseStyleString, persistRenderSettings, resolveDomEditSelection, resolveEquidistanceGuides, resolveGuideLineRect, resolveIframe, resolveSnapAdjustment, resolveSourceFile, revertNewestStudioPendingEdit, setStudioKeys, snapEngagedForTravel, useAudioGainDialogStore, useAudioMetersVisible, useClipboard, useCompositionStack, useDockLayoutStore, useDomEditSelectionContext, useDomEditSession, useDomEditZOrder, useDomGeometryCommit, useDomStyleCommit, useEditHistoryActions, useElementPicker, useLivePreviewIframe, useMarqueeGestures, usePersistentEditHistory, usePlayerHandle, usePlayerStore, usePreviewCompositionRect, usePreviewGuidesStore, usePreviewIframeStore, usePreviewOverlayContext, usePreviewPersistence, useProjectFileWriter, useRenderClipContent, useRenderQueue, useStudioKeys, useThumbnailStill, useTimelineContext, useTimelineEditing, useTimelinePlayer, zoomTimelineToRange };
|
|
4471
|
+
export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, AudioMeterStrip, type AudioMeterStripProps, AudioWaveform, type AudioWaveformProps, type BlockedTimelineEditIntent, type CanEditTimelineElement, ColorField, type Combo, CompositionBreadcrumb, type CompositionDimensions, type CompositionLevel, CompositionThumbnail, ConnectedDomEditOverlay, type ConnectedDomEditOverlayProps, DEFAULT_SHORTCUT_SECTIONS, DEFAULT_STUDIO_KEYS, Dock, type DockController, type DomEditCapabilities, type DomEditCommitDeclineReason, type DomEditCommitOutcome, type DomEditGroupPathOffsetCommit, DomEditOverlay, type DomEditOverlayProps, DomEditProvider, type DomEditSelection, type DomEditZOrder, type DomGeometryCommits, type EditHistoryHandle, EditorShell, type EditorShellProps, type ExternalFileChangeBlockedState, type ExternalFileChangeCoordinatorHandle, ExternalFileConflictBanner, type FadeEdge, type FadeHandleBox, type FadeHandleClipBox, type FfmpegStatus, FileTree, GradientField, GridOverlay, ImageThumbnail, type ImageThumbnailProps, LayersPanel, type LayersPanelHost, type LinkShortcutCallbacks, type MarqueeGestures, type MarqueeGesturesDeps, MarqueeOverlay, type MarqueeOverlayProps, type Rect$1 as MarqueeRect, type ModelContextTool, NLEPreview, type PanelId, type PatchOperation, type PersistedRenderSettings, type PickedElement, type PlaybackHealth, PlayerControls, type PlayerHandle, type PlayerHandleElement, type PlayerHandleListener, type PlayerHandleTimeListener, type DomEditCompositionRect as PreviewCompositionRect, type PreviewCopies, type PreviewFacts, PreviewGuides, PreviewOverlayProvider, type PreviewOverlayProviderProps, type PreviewPromotion, type PreviewQualityChosenBy, PreviewReadOnlyProvider, type PreviewSnapPreferences, PropertyPanel, type RenderJob, RenderQueue, type RenderQueueProps, type ResolutionPreset, SNAP_THRESHOLD_PX, type ShortcutHint, type ShortcutSection, ShortcutsButton, type ShortcutsButtonProps, type SnapContext, type SnapEdge, type SnapGuide, SnapGuideOverlay, type SnapGuideOverlayProps, type SnapGuidesState, type Rect as SnapRect, type SnapResult, type SnapTarget, SnapToolbar, SourceEditor, type SpacingGuide, type StartRenderOptions, type StudioAgentToolsDeps, StudioApp, StudioFileConflictError, type StudioKeyAction, type StudioKeys, type StudioLookSnapshot, type StudioPendingEditsDrainResult, TRACK_H, type ThumbnailPriority, type ThumbnailStill, Timeline, TimelineClipMenu, type TimelineClipMenuItem, type TimelineClipRenderContext, type TimelineEditCallbacks, type TimelineEditOutcome, type TimelineEditPermission, TimelineEditPopover, TimelineEditProvider, type TimelineElement, TimelineEmptyStatePart, TimelineFrame, TimelineGapMenu, TimelineHistoryButtons, type TimelineHistoryButtonsProps, TimelineKeyframeMenu, TimelineLanes, TimelineOverlays, TimelinePane, type TimelinePaneProps, TimelinePlayhead, TimelineProvider, TimelineRazorGuide, TimelineRuler, TimelineShortcutHint, type TimelineTheme, type TimelineTimeRange$1 as TimelineTimeRange, TimelineToolbar, type TimelineToolbarProps, type TimelineTrackPadding, type TimelineZIndexReorderCommit, type ToolResult, type UseClipboardOptions, type UseDomEditSessionParams, type UseDomGeometryCommitOptions, type UseDomStyleCommitOptions, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UsePreviewPersistenceParams, type UseProjectFileWriterOptions, type UseRenderClipContentOptions, type UseThumbnailStillOptions, type UseTimelineEditingOptions, VideoThumbnail, type ZOrderAction, announcePreviewDocumentLoaded, applyPatch, buildCompositionSnapTarget, buildGridSnapEdges, buildPickerAgentContextPreview, buildPickerAgentPrompt, buildShortcutSections, buildStudioTools, cancelNewestStudioWaitingPress, collectSnapContext, collectStudioLookScene, currentTimelineRange, dispatchLinkShortcut, displayTrackOrder, extractSnapTargets, fadeHandleBoxes, findElementBlock, flushStudioPendingEdits, formatCombo, formatTime, getPersistedRenderSettings, getStudioKeys, liveTime, matchCombo, mergeStyleIntoTag, openAudioGainDialog, parseCombo, parseStyleString, persistRenderSettings, resolveDomEditSelection, resolveEquidistanceGuides, resolveGuideLineRect, resolveIframe, resolveSnapAdjustment, resolveSourceFile, revertNewestStudioPendingEdit, setStudioKeys, snapEngagedForTravel, studioKeyClash, useAudioGainDialogStore, useAudioMetersVisible, useClipboard, useCompositionStack, useDockLayoutStore, useDomEditSelectionContext, useDomEditSession, useDomEditZOrder, useDomGeometryCommit, useDomStyleCommit, useEditHistoryActions, useElementPicker, useLivePreviewIframe, useMarqueeGestures, usePersistentEditHistory, usePlayerHandle, usePlayerStore, usePreviewCompositionRect, usePreviewGuidesStore, usePreviewIframeStore, usePreviewOverlayContext, usePreviewPersistence, useProjectFileWriter, useRenderClipContent, useRenderQueue, useStudioKeys, useThumbnailStill, useTimelineContext, useTimelineEditing, useTimelinePlayer, zoomTimelineToRange };
|
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.dataset.theme = "paper";
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-ZDVj-MKT.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-RUPGNyct.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
package/dist/index.js
CHANGED
|
@@ -356,6 +356,15 @@ function findClash(keys) {
|
|
|
356
356
|
}
|
|
357
357
|
return null;
|
|
358
358
|
}
|
|
359
|
+
function studioKeyClash(action, text, keys = current) {
|
|
360
|
+
const wanted = parseCombo(text);
|
|
361
|
+
const holds = (other) => {
|
|
362
|
+
const held = parseCombo(keys[other]);
|
|
363
|
+
return !!held && !!wanted && comboClashKey(held) === comboClashKey(wanted);
|
|
364
|
+
};
|
|
365
|
+
const keyed = Object.keys(keys);
|
|
366
|
+
return keyed.find((o) => o !== action && !sharedByDesign(action, o) && holds(o)) ?? null;
|
|
367
|
+
}
|
|
359
368
|
function resolve(overrides) {
|
|
360
369
|
const next = { ...DEFAULT_STUDIO_KEYS };
|
|
361
370
|
for (const [action, text] of Object.entries(overrides)) {
|
|
@@ -102793,12 +102802,15 @@ export {
|
|
|
102793
102802
|
fieldText,
|
|
102794
102803
|
findElementBlock,
|
|
102795
102804
|
flushStudioPendingEdits,
|
|
102805
|
+
formatCombo,
|
|
102796
102806
|
formatTime,
|
|
102797
102807
|
getPersistedRenderSettings,
|
|
102798
102808
|
getStudioKeys,
|
|
102799
102809
|
liveTime,
|
|
102810
|
+
matchCombo,
|
|
102800
102811
|
mergeStyleIntoTag,
|
|
102801
102812
|
openAudioGainDialog,
|
|
102813
|
+
parseCombo,
|
|
102802
102814
|
parseStyleString,
|
|
102803
102815
|
persistRenderSettings,
|
|
102804
102816
|
playSeamTransitionLoop,
|
|
@@ -102812,6 +102824,7 @@ export {
|
|
|
102812
102824
|
revertNewestStudioPendingEdit,
|
|
102813
102825
|
setStudioKeys,
|
|
102814
102826
|
snapEngagedForTravel,
|
|
102827
|
+
studioKeyClash,
|
|
102815
102828
|
useAudioGainDialogStore,
|
|
102816
102829
|
useAudioMetersVisible,
|
|
102817
102830
|
useClipboard,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/studio",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"dockview-react": "8.3.1",
|
|
61
61
|
"gsap": "^3.13.0",
|
|
62
62
|
"mediabunny": "^1.45.3",
|
|
63
|
-
"@hyperframes/core": "0.9.
|
|
64
|
-
"@hyperframes/parsers": "0.9.
|
|
65
|
-
"@hyperframes/
|
|
66
|
-
"@hyperframes/shader-transitions": "0.9.
|
|
67
|
-
"@hyperframes/
|
|
68
|
-
"@hyperframes/
|
|
63
|
+
"@hyperframes/core": "0.9.2",
|
|
64
|
+
"@hyperframes/parsers": "0.9.2",
|
|
65
|
+
"@hyperframes/player": "0.9.2",
|
|
66
|
+
"@hyperframes/shader-transitions": "0.9.2",
|
|
67
|
+
"@hyperframes/studio-server": "0.9.2",
|
|
68
|
+
"@hyperframes/sdk": "0.9.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vite": "^6.4.2",
|
|
83
83
|
"vitest": "^4.1.11",
|
|
84
84
|
"zustand": "^5.0.0",
|
|
85
|
-
"@hyperframes/producer": "0.9.
|
|
85
|
+
"@hyperframes/producer": "0.9.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": "19",
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,11 @@ export {
|
|
|
11
11
|
buildShortcutSections,
|
|
12
12
|
getStudioKeys,
|
|
13
13
|
setStudioKeys,
|
|
14
|
+
studioKeyClash,
|
|
14
15
|
useStudioKeys,
|
|
15
16
|
} from "./player/components/studioShortcuts";
|
|
17
|
+
export { formatCombo, matchCombo, parseCombo } from "./player/components/studioCombo";
|
|
18
|
+
export type { Combo } from "./player/components/studioCombo";
|
|
16
19
|
export type { StudioKeyAction, StudioKeys } from "./player/components/studioShortcuts";
|
|
17
20
|
export { ShortcutsButton } from "./player/components/ShortcutsPanel";
|
|
18
21
|
export { dispatchLinkShortcut } from "./hooks/linkShortcuts";
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { formatCombo, matchCombo, parseCombo } from "./studioCombo";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getStudioKey,
|
|
6
|
+
getStudioKeys,
|
|
7
|
+
keyHint,
|
|
8
|
+
matchesKey,
|
|
9
|
+
setStudioKeys,
|
|
10
|
+
studioKeyClash,
|
|
11
|
+
} from "./studioShortcuts";
|
|
5
12
|
|
|
6
13
|
afterEach(() => {
|
|
7
14
|
setStudioKeys(null);
|
|
8
15
|
vi.restoreAllMocks();
|
|
9
16
|
});
|
|
10
17
|
|
|
18
|
+
const getAll = () => ({ ...getStudioKeys() });
|
|
11
19
|
const press = (init: KeyboardEventInit) => new KeyboardEvent("keydown", init);
|
|
12
20
|
const matches = (text: string, init: KeyboardEventInit) =>
|
|
13
21
|
matchCombo(press(init), parseCombo(text)!);
|
|
@@ -97,3 +105,15 @@ describe("combos with symbol keys", () => {
|
|
|
97
105
|
expect(parseCombo("shift+1")).toBeNull();
|
|
98
106
|
});
|
|
99
107
|
});
|
|
108
|
+
|
|
109
|
+
describe("studioKeyClash", () => {
|
|
110
|
+
it("names the action that holds a combo, by modifiers and key, and lets a design-shared pair through", () => {
|
|
111
|
+
expect(studioKeyClash("mute", "mod+z")).toBe("undo");
|
|
112
|
+
expect(studioKeyClash("mute", "mod+shift+z")).toBe("redo");
|
|
113
|
+
expect(studioKeyClash("mute", "q")).toBeNull();
|
|
114
|
+
expect(studioKeyClash("pause", "k")).toBeNull();
|
|
115
|
+
expect(studioKeyClash("mute", "b")).toBe("razorTool");
|
|
116
|
+
expect(studioKeyClash("mute", "mod+z", { ...getAll(), undo: "q" })).toBeNull();
|
|
117
|
+
expect(studioKeyClash("mute", "q", { ...getAll(), undo: "" })).toBeNull();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -110,6 +110,20 @@ function findClash(keys: StudioKeys): string | null {
|
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
export function studioKeyClash(
|
|
114
|
+
action: StudioKeyAction,
|
|
115
|
+
text: string,
|
|
116
|
+
keys: StudioKeys = current,
|
|
117
|
+
): StudioKeyAction | null {
|
|
118
|
+
const wanted = parseCombo(text);
|
|
119
|
+
const holds = (other: StudioKeyAction) => {
|
|
120
|
+
const held = parseCombo(keys[other]);
|
|
121
|
+
return !!held && !!wanted && comboClashKey(held) === comboClashKey(wanted);
|
|
122
|
+
};
|
|
123
|
+
const keyed = Object.keys(keys) as StudioKeyAction[];
|
|
124
|
+
return keyed.find((o) => o !== action && !sharedByDesign(action, o) && holds(o)) ?? null;
|
|
125
|
+
}
|
|
126
|
+
|
|
113
127
|
function resolve(overrides: Partial<Record<StudioKeyAction, string>>): StudioKeys {
|
|
114
128
|
const next: Record<string, string> = { ...DEFAULT_STUDIO_KEYS };
|
|
115
129
|
for (const [action, text] of Object.entries(overrides)) {
|