@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
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  createThumbnailRequestIdentity,
26
26
  createTimelineResetState,
27
27
  effectiveThumbnailMode,
28
+ fetchFrameToken,
28
29
  formatFrameTime,
29
30
  formatTime,
30
31
  frameOrigins,
@@ -59,6 +60,7 @@ import {
59
60
  postRuntimeControlMessage,
60
61
  previewClipManifest,
61
62
  previewComputedStyles,
63
+ previewConsoleErrors,
62
64
  previewEditingClient,
63
65
  previewFrameOpaque,
64
66
  previewReloadBegun,
@@ -89,7 +91,7 @@ import {
89
91
  whileScriptWrites,
90
92
  writeStudioUiPreferences,
91
93
  zoomToSelectedClips
92
- } from "./chunk-F6EHWNZU.js";
94
+ } from "./chunk-K3IOYISK.js";
93
95
  import {
94
96
  Button,
95
97
  ContextMenu,
@@ -124,13 +126,8 @@ import {
124
126
  popupSurface
125
127
  } from "./chunk-G6FJSL7X.js";
126
128
  import {
127
- DEFAULT_STUDIO_KEYS,
128
- comboClashKey,
129
- comboText,
130
- formatCombo,
131
- matchCombo,
132
- parseCombo
133
- } from "./chunk-5ZHKYODQ.js";
129
+ DEFAULT_STUDIO_KEYS
130
+ } from "./chunk-USW3YBOG.js";
134
131
  import {
135
132
  DOM_EDIT_LAYER_OBSERVER_INIT,
136
133
  buildDefaultDomEditTextField,
@@ -161,12 +158,13 @@ import {
161
158
  selectionTargetIndex,
162
159
  serializeDomEditTextFields,
163
160
  timelineElementLookup
164
- } from "./chunk-GVW7AU57.js";
161
+ } from "./chunk-UM4CLD4M.js";
165
162
  import {
166
163
  CURATED_STYLE_PROPERTIES,
167
164
  LAYER_REVEAL_PRIOR_POSITION_ATTR,
168
165
  LAYER_REVEAL_PRIOR_Z_ATTR,
169
166
  STUDIO_FLAT_INSPECTOR_ENABLED,
167
+ STUDIO_OPAQUE_PREVIEW_ENABLED,
170
168
  STUDIO_SDK_CUTOVER_ENABLED,
171
169
  STUDIO_SDK_CUTOVER_FAMILIES,
172
170
  STUDIO_SDK_RESOLVER_SHADOW_ENABLED,
@@ -235,7 +233,7 @@ import {
235
233
  toHexColor,
236
234
  withSelectorIndexPass,
237
235
  wrapTimeline
238
- } from "./chunk-VHV2ZDKY.js";
236
+ } from "./chunk-OOGQ5KCC.js";
239
237
  import {
240
238
  MediaFetchError,
241
239
  mediaUrlSourceOptions,
@@ -248,6 +246,13 @@ import { memo as memo35, useCallback as useCallback78 } from "react";
248
246
 
249
247
  // src/player/components/studioShortcuts.ts
250
248
  import { useSyncExternalStore } from "react";
249
+ import {
250
+ comboClashKey,
251
+ comboText,
252
+ formatCombo,
253
+ matchCombo,
254
+ parseCombo
255
+ } from "@hyperframes/core/key-combo";
251
256
  var SHARED_BY_DESIGN = [
252
257
  ["pause", "addKeyframe"],
253
258
  ["seekToIn", "exitRazor"],
@@ -854,39 +859,8 @@ var flatIdle = `${flatBtn} text-text-2 hover:bg-hover hover:text-text-0 active:b
854
859
  var flatActive = `${flatBtn} bg-on text-text-0 hover:bg-on-hover active:scale-[0.98]`;
855
860
  var flatDisabled = `${flatBtn} text-text-off cursor-not-allowed`;
856
861
 
857
- // src/utils/typingTarget.ts
858
- function isTypingTarget(target) {
859
- const element = asElement(target);
860
- if (!element) return false;
861
- if (element.isContentEditable) return true;
862
- return element.closest(TYPING_SELECTOR) !== null;
863
- }
864
- function ownsPlainKeys(target) {
865
- return isTypingTarget(target) || asElement(target)?.closest(KEY_OWNING_CONTROLS) != null;
866
- }
867
- var KEY_OWNING_CONTROLS = "[role='slider'],video[controls],audio[controls]";
868
- var TYPING_SELECTOR = [
869
- "input",
870
- "textarea",
871
- "select",
872
- "[contenteditable]:not([contenteditable='false'])",
873
- "[role='textbox']",
874
- "[role='searchbox']",
875
- "[role='combobox']",
876
- // A switch is a button in the DOM, but the native checkbox it replaces was an
877
- // `input` and matched above. Without this row the shared Toggle would let a
878
- // global shortcut claim Space instead of flipping the control (KTD13).
879
- "[role='switch']",
880
- "[role='dialog'][aria-modal='true']",
881
- ".cm-editor"
882
- ].join(",");
883
- function asElement(target) {
884
- if (!target || typeof target !== "object") return null;
885
- const candidate = target;
886
- return typeof candidate.closest === "function" ? target : null;
887
- }
888
-
889
862
  // src/player/components/ShortcutsPanel.tsx
863
+ import { isTypingTarget } from "@hyperframes/core/typing-target";
890
864
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
891
865
  var STAY_ABOVE = { side: "none", align: "shift", fallbackAxisSide: "none" };
892
866
  function useShortcutsOpen() {
@@ -10069,6 +10043,7 @@ async function retryStudioSave(operation, options = {}) {
10069
10043
  }
10070
10044
 
10071
10045
  // src/utils/studioPendingEdits.ts
10046
+ import { isTypingTarget as isTypingTarget2 } from "@hyperframes/core/typing-target";
10072
10047
  var STUDIO_FLUSH_PENDING_EDITS_EVENT = "hf-studio-flush-pending-edits";
10073
10048
  var pendingEdits = /* @__PURE__ */ new Map();
10074
10049
  var historyClaims = () => 0;
@@ -10101,7 +10076,7 @@ function inspectDrainFailures(results) {
10101
10076
  }
10102
10077
  function focusedField() {
10103
10078
  const active = document.activeElement;
10104
- return active instanceof HTMLElement && isTypingTarget(active) ? active : null;
10079
+ return active instanceof HTMLElement && isTypingTarget2(active) ? active : null;
10105
10080
  }
10106
10081
  function hasStudioPendingEdits() {
10107
10082
  return pendingEdits.size > 0 || focusedField() !== null;
@@ -21661,6 +21636,7 @@ import {
21661
21636
  } from "@hyperframes/core/audio-automation";
21662
21637
 
21663
21638
  // src/utils/studioHelpers.ts
21639
+ import { isTypingTarget as isTypingTarget3 } from "@hyperframes/core/typing-target";
21664
21640
  import { encodeUrlPath as encodeUrlPath2 } from "@hyperframes/parsers";
21665
21641
  function getTimelineElementLabel(element) {
21666
21642
  return element.label || element.id || element.tag;
@@ -21711,7 +21687,7 @@ function isManualGeometryStyleProperty(property) {
21711
21687
  return property === "left" || property === "top" || property === "width" || property === "height";
21712
21688
  }
21713
21689
  function shouldIgnoreHistoryShortcut(target) {
21714
- return isTypingTarget(target);
21690
+ return isTypingTarget3(target);
21715
21691
  }
21716
21692
  function getHistoryShortcutLabel(action) {
21717
21693
  const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform);
@@ -21866,6 +21842,7 @@ async function resolveAssetHasAudio(projectId, assetPath) {
21866
21842
  }
21867
21843
 
21868
21844
  // src/hooks/useAutomationSelectionKeyboard.ts
21845
+ import { isTypingTarget as isTypingTarget4 } from "@hyperframes/core/typing-target";
21869
21846
  function elementKeyOf(element) {
21870
21847
  return element.key ?? element.id;
21871
21848
  }
@@ -21965,7 +21942,7 @@ function handleCopy(e, state, lanes, sel) {
21965
21942
  return true;
21966
21943
  }
21967
21944
  function automationOwnsKey(e) {
21968
- if (isTypingTarget(document.activeElement)) return false;
21945
+ if (isTypingTarget4(document.activeElement)) return false;
21969
21946
  const state = usePlayerStore.getState();
21970
21947
  if (matchesKey(e, "copy")) return state.automationSelection !== null;
21971
21948
  if (!matchesKey(e, "paste")) return false;
@@ -21989,7 +21966,7 @@ function useAutomationSelectionKeyboard({
21989
21966
  }) {
21990
21967
  useEffect28(() => {
21991
21968
  const handler = (e) => {
21992
- if (isTypingTarget(document.activeElement)) return;
21969
+ if (isTypingTarget4(document.activeElement)) return;
21993
21970
  if (e.defaultPrevented) return;
21994
21971
  const state = usePlayerStore.getState();
21995
21972
  if (handlePaste(e, state, lanes)) return;
@@ -29166,33 +29143,13 @@ var useCaptionStore = create6((set, get) => ({
29166
29143
  }));
29167
29144
 
29168
29145
  // src/player/lib/playbackShortcuts.ts
29146
+ import { shouldIgnorePlaybackShortcutTarget } from "@hyperframes/core/typing-target";
29169
29147
  var FRAME_STEP_ACTIONS = [
29170
29148
  "frameBack",
29171
29149
  "frameForward",
29172
29150
  "frameBackTen",
29173
29151
  "frameForwardTen"
29174
29152
  ];
29175
- var PLAYBACK_SHORTCUT_IGNORED_SELECTOR = [
29176
- "button",
29177
- "a[href]",
29178
- "[role='button']",
29179
- "[role='checkbox']",
29180
- "[role='menuitem']",
29181
- // Base UI's menu radio item is a `<div>`, so `button` above no longer catches it.
29182
- "[role='menuitemradio']",
29183
- "[role='radio']",
29184
- "[role='spinbutton']"
29185
- ].join(",");
29186
- function shouldIgnorePlaybackShortcutTarget(target) {
29187
- if (ownsPlainKeys(target)) return true;
29188
- if (!target || typeof target !== "object") return false;
29189
- const candidate = target;
29190
- if (typeof candidate.closest !== "function") return false;
29191
- return candidate.closest.call(
29192
- target,
29193
- PLAYBACK_SHORTCUT_IGNORED_SELECTOR
29194
- ) !== null;
29195
- }
29196
29153
  var MODAL_DIALOG_SELECTOR = "[role=dialog][aria-modal=true]";
29197
29154
  function isModalDialogOpen() {
29198
29155
  const doc = globalThis.document;
@@ -30768,7 +30725,8 @@ function withParsedStart(read2, live) {
30768
30725
  return moved ? { ...read2, start } : read2;
30769
30726
  }
30770
30727
  function findParsedTween(iframe, element, anim) {
30771
- const win = iframe?.contentWindow;
30728
+ if (!iframe || previewFrameOpaque(iframe)) return null;
30729
+ const win = iframe.contentWindow;
30772
30730
  const start = resolveTweenStart(anim);
30773
30731
  if (!win?.__timelines || start == null) return null;
30774
30732
  const steps = anim.keyframes?.keyframes.map((kf) => kf.properties) ?? [anim.properties];
@@ -34209,7 +34167,8 @@ var NLEPreview = memo24(function NLEPreview2({
34209
34167
  onStageRef,
34210
34168
  onCompositionSizeChange,
34211
34169
  fillBox,
34212
- compositionSizeHint
34170
+ compositionSizeHint,
34171
+ sandboxOrigin
34213
34172
  }) {
34214
34173
  const activeKey = getPreviewPlayerKey({ projectId, directUrl });
34215
34174
  const viewportRef = useRef56(null);
@@ -34542,6 +34501,7 @@ var NLEPreview = memo24(function NLEPreview2({
34542
34501
  },
34543
34502
  portrait,
34544
34503
  suppressLoadingOverlay: true,
34504
+ sandboxOrigin,
34545
34505
  style: { position: "absolute", inset: 0, zIndex: 0 }
34546
34506
  },
34547
34507
  `backdrop-${projectId}`
@@ -34565,6 +34525,7 @@ var NLEPreview = memo24(function NLEPreview2({
34565
34525
  portrait,
34566
34526
  suppressLoadingOverlay,
34567
34527
  loadingUi,
34528
+ sandboxOrigin,
34568
34529
  style: directUrl?.includes("/components/") ? { position: "absolute", inset: 0, zIndex: 1 } : void 0
34569
34530
  },
34570
34531
  `${activeKey}-${slot.gen}`
@@ -34582,6 +34543,7 @@ var NLEPreview = memo24(function NLEPreview2({
34582
34543
  portrait,
34583
34544
  suppressLoadingOverlay: true,
34584
34545
  noLoadTimeout: true,
34546
+ sandboxOrigin,
34585
34547
  style: SHADOW_IFRAME_STYLE
34586
34548
  },
34587
34549
  `${activeKey}-${slot.gen}`
@@ -35418,7 +35380,8 @@ function PreviewPane({
35418
35380
  directUrl,
35419
35381
  suppressLoadingOverlay: hasLoadedOnceRef.current,
35420
35382
  onStageRef: handleStageRef,
35421
- onCompositionSizeChange: setPreviewCompositionSize
35383
+ onCompositionSizeChange: setPreviewCompositionSize,
35384
+ sandboxOrigin: STUDIO_OPAQUE_PREVIEW_ENABLED ? "opaque" : void 0
35422
35385
  }
35423
35386
  ),
35424
35387
  previewDragOver && /* @__PURE__ */ jsx89("div", { className: "absolute inset-2 z-40 rounded-lg border-2 border-dashed border-studio-accent/50 bg-studio-accent/4 pointer-events-none" }),
@@ -37091,7 +37054,11 @@ import { useCallback as useCallback70 } from "react";
37091
37054
  // src/captions/components/CaptionOverlay.tsx
37092
37055
  import { memo as memo27, useEffect as useEffect50, useState as useState49, useCallback as useCallback57, useRef as useRef66 } from "react";
37093
37056
 
37057
+ // src/utils/timelineDiscovery.ts
37058
+ import { isTypingTarget as isTypingTarget5 } from "@hyperframes/core/typing-target";
37059
+
37094
37060
  // src/captions/keyboard.ts
37061
+ import { ownsPlainKeys } from "@hyperframes/core/typing-target";
37095
37062
  function resolveCaptionNudge(event, target) {
37096
37063
  if (target != null && ownsPlainKeys(target)) return null;
37097
37064
  return resolveCanvasNudgeDelta(event);
@@ -37397,7 +37364,7 @@ var CaptionOverlay = memo27(function CaptionOverlay2({ iframeRef }) {
37397
37364
  }
37398
37365
  return;
37399
37366
  }
37400
- if (matchesKey(e, "captionSelectAll") && !isTypingTarget(e.target)) {
37367
+ if (matchesKey(e, "captionSelectAll") && !isTypingTarget5(e.target)) {
37401
37368
  e.preventDefault();
37402
37369
  store.selectAll();
37403
37370
  return;
@@ -40012,7 +39979,7 @@ function OffCanvasIndicators({
40012
39979
  const selectOffCanvas = async () => {
40013
39980
  const el = elements.current.get(r.key);
40014
39981
  if (!el) return;
40015
- const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-SA5KLSSS.js");
39982
+ const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-IHYA42AJ.js");
40016
39983
  const acp = activeCompositionPathRef.current ?? "index.html";
40017
39984
  const sel = await resolveDomEditSelection2(el, {
40018
39985
  activeCompositionPath: acp,
@@ -42958,6 +42925,7 @@ function createDomEditOverlayGestureHandlers(opts) {
42958
42925
 
42959
42926
  // src/components/editor/useDomEditNudge.ts
42960
42927
  import { useCallback as useCallback61, useEffect as useEffect54, useRef as useRef70 } from "react";
42928
+ import { ownsPlainKeys as ownsPlainKeys2 } from "@hyperframes/core/typing-target";
42961
42929
  function selectionIdentityKey(selection) {
42962
42930
  if (!selection) return "";
42963
42931
  return [
@@ -42984,7 +42952,7 @@ function resolveSingleNudgeTarget(sel, rect) {
42984
42952
  function shouldIgnoreNudgeKey(p, event) {
42985
42953
  if (!p.allowCanvasMovement || event.defaultPrevented) return true;
42986
42954
  if (p.gestureRef.current || p.groupGestureRef.current || p.blockedMoveRef.current) return true;
42987
- return ownsPlainKeys(event.target);
42955
+ return ownsPlainKeys2(event.target);
42988
42956
  }
42989
42957
  function useDomEditNudge(params) {
42990
42958
  const sessionRef = useRef70(null);
@@ -50909,6 +50877,7 @@ var MotionPathOverlay = memo31(function MotionPathOverlay2({
50909
50877
  // src/components/editor/SnapToolbar.tsx
50910
50878
  import { memo as memo32, useCallback as useCallback69, useEffect as useEffect67, useRef as useRef83, useState as useState62 } from "react";
50911
50879
  import { MagnetStraight, GridFour, Path, Ruler, FrameCorners } from "@phosphor-icons/react";
50880
+ import { ownsPlainKeys as ownsPlainKeys3 } from "@hyperframes/core/typing-target";
50912
50881
  import { jsx as jsx117, jsxs as jsxs82 } from "react/jsx-runtime";
50913
50882
  var SnapToolbar = memo32(function SnapToolbar2() {
50914
50883
  const keys = useStudioKeys();
@@ -50947,7 +50916,7 @@ var SnapToolbar = memo32(function SnapToolbar2() {
50947
50916
  useEffect67(() => {
50948
50917
  const handleKeyDown = (e) => {
50949
50918
  if (e.defaultPrevented) return;
50950
- if (ownsPlainKeys(e.target)) return;
50919
+ if (ownsPlainKeys3(e.target)) return;
50951
50920
  if (e.target instanceof HTMLIFrameElement) return;
50952
50921
  if (matchesKey(e, "snap")) {
50953
50922
  e.preventDefault();
@@ -55148,7 +55117,11 @@ function EditorShellBody({
55148
55117
  );
55149
55118
  }
55150
55119
 
55120
+ // src/index.ts
55121
+ import { formatCombo as formatCombo2, matchCombo as matchCombo2, parseCombo as parseCombo2 } from "@hyperframes/core/key-combo";
55122
+
55151
55123
  // src/hooks/linkShortcuts.ts
55124
+ import { isTypingTarget as isTypingTarget6 } from "@hyperframes/core/typing-target";
55152
55125
  var ACTIONS = [
55153
55126
  ["linkToggle", "linkToggle"],
55154
55127
  ["detachAudio", "detachAudio"],
@@ -55160,7 +55133,7 @@ var shortcutOf = (event) => {
55160
55133
  return hit ? keyHint(hit[1]) : null;
55161
55134
  };
55162
55135
  function dispatchLinkShortcut(event, cb) {
55163
- if (isTypingTarget(event.target)) return false;
55136
+ if (isTypingTarget6(event.target)) return false;
55164
55137
  const shortcut = shortcutOf(event);
55165
55138
  if (!shortcut) return false;
55166
55139
  const { elements, selectedElementId, selectedElementIds } = usePlayerStore.getState();
@@ -70006,6 +69979,7 @@ function MediaFadeSliders({
70006
69979
  function createGsapLivePreview(iframeRef) {
70007
69980
  return (el, props) => {
70008
69981
  const iframe = iframeRef.current;
69982
+ if (!iframe || previewFrameOpaque(iframe)) return;
70009
69983
  const win = iframe?.contentWindow;
70010
69984
  const node = findPreviewNode(iframe?.contentDocument, el);
70011
69985
  if (win?.gsap && node) win.gsap.set(node, props);
@@ -90501,6 +90475,7 @@ function useBlockHandlers({
90501
90475
  import { useCallback as useCallback159, useEffect as useEffect135, useRef as useRef165 } from "react";
90502
90476
 
90503
90477
  // src/hooks/appHotkeysDispatch.ts
90478
+ import { isTypingTarget as isTypingTarget7, ownsPlainKeys as ownsPlainKeys4 } from "@hyperframes/core/typing-target";
90504
90479
  function handleUndoRedoKey(event, onUndo, onRedo) {
90505
90480
  const isUndo = matchesKey(event, "undo");
90506
90481
  if (!isUndo && !matchesKey(event, "redo") && !matchesKey(event, "redoAlt")) return false;
@@ -90522,7 +90497,7 @@ function dispatchTabKey(event) {
90522
90497
  function dispatchGroupKey(event, cb) {
90523
90498
  const group = matchesKey(event, "group");
90524
90499
  if (!group && !matchesKey(event, "ungroup")) return false;
90525
- if (isTypingTarget(event.target)) return false;
90500
+ if (isTypingTarget7(event.target)) return false;
90526
90501
  event.preventDefault();
90527
90502
  if (cb.readOnlyPreview) return true;
90528
90503
  if (group) cb.onGroupSelection?.();
@@ -90530,7 +90505,7 @@ function dispatchGroupKey(event, cb) {
90530
90505
  return true;
90531
90506
  }
90532
90507
  function dispatchClipboardKey(event, cb) {
90533
- if (isTypingTarget(event.target)) return false;
90508
+ if (isTypingTarget5(event.target)) return false;
90534
90509
  const copy = matchesKey(event, "copy");
90535
90510
  const paste = matchesKey(event, "paste");
90536
90511
  const cut = matchesKey(event, "cut");
@@ -90584,7 +90559,7 @@ function dispatchModifierKey(event, _key, cb) {
90584
90559
  return dispatchTabKey(event) || dispatchGroupKey(event, cb) || dispatchClipboardKey(event, cb);
90585
90560
  }
90586
90561
  function dispatchPlainKey(event, _key, cb) {
90587
- if (ownsPlainKeys(event.target)) return;
90562
+ if (ownsPlainKeys4(event.target)) return;
90588
90563
  const keys = getStudioKeys();
90589
90564
  if (matchesKey(event, "zoomSelection")) {
90590
90565
  if (!zoomTimelineToSelectedClips()) return;
@@ -91859,7 +91834,11 @@ function useCaptionDetection({
91859
91834
 
91860
91835
  // src/hooks/useConsoleErrorCapture.ts
91861
91836
  import { useCallback as useCallback161, useEffect as useEffect137, useRef as useRef168, useState as useState134 } from "react";
91862
- import { STUDIO_PREVIEW_ERRORS } from "@hyperframes/core/studio-preview-mark";
91837
+ import {
91838
+ previewConsoleErrorText,
91839
+ STUDIO_PREVIEW_ERRORS
91840
+ } from "@hyperframes/core/studio-preview-mark";
91841
+ var SEALED_POLL_MS = 1e3;
91863
91842
  function useConsoleErrorCapture(previewIframe) {
91864
91843
  const [consoleErrors, setConsoleErrors] = useState134(null);
91865
91844
  const consoleErrorsRef = useRef168([]);
@@ -91873,7 +91852,39 @@ function useConsoleErrorCapture(previewIframe) {
91873
91852
  let patchedWin = null;
91874
91853
  let origConsoleError = null;
91875
91854
  let errorHandler = null;
91855
+ let stopSealedReads = null;
91856
+ const record2 = (texts) => {
91857
+ if (texts.length === 0) return;
91858
+ consoleErrorsRef.current = [
91859
+ ...consoleErrorsRef.current,
91860
+ ...texts.map((message) => ({ severity: "error", message }))
91861
+ ];
91862
+ setConsoleErrors([...consoleErrorsRef.current]);
91863
+ };
91864
+ const readSealedErrors = (iframe) => {
91865
+ let live = true;
91866
+ let read2 = 0;
91867
+ let timer;
91868
+ const poll = async () => {
91869
+ for (; ; ) {
91870
+ const page = await previewConsoleErrors(iframe, read2);
91871
+ if (!live) return;
91872
+ if (!page) break;
91873
+ read2 += page.errors.length;
91874
+ record2(page.errors);
91875
+ if (!page.truncated || page.errors.length === 0) break;
91876
+ }
91877
+ timer = setTimeout(poll, SEALED_POLL_MS);
91878
+ };
91879
+ void poll();
91880
+ return () => {
91881
+ live = false;
91882
+ clearTimeout(timer);
91883
+ };
91884
+ };
91876
91885
  const detachErrorCapture = () => {
91886
+ stopSealedReads?.();
91887
+ stopSealedReads = null;
91877
91888
  const win = patchedWin;
91878
91889
  if (!win) return;
91879
91890
  patchedWin = null;
@@ -91889,25 +91900,21 @@ function useConsoleErrorCapture(previewIframe) {
91889
91900
  const attachErrorCapture = () => {
91890
91901
  detachErrorCapture();
91891
91902
  resetErrors();
91903
+ if (previewFrameOpaque(previewIframe)) {
91904
+ stopSealedReads = readSealedErrors(previewIframe);
91905
+ return;
91906
+ }
91892
91907
  try {
91893
91908
  const win = previewIframe.contentWindow;
91894
91909
  if (!win) return;
91895
91910
  if (win.__hfErrorCapture) return;
91896
91911
  win.__hfErrorCapture = true;
91897
91912
  patchedWin = win;
91898
- const record2 = (texts) => {
91899
- if (texts.length === 0) return;
91900
- consoleErrorsRef.current = [
91901
- ...consoleErrorsRef.current,
91902
- ...texts.map((message) => ({ severity: "error", message }))
91903
- ];
91904
- setConsoleErrors([...consoleErrorsRef.current]);
91905
- };
91906
91913
  origConsoleError = win.console.error.bind(win.console);
91907
91914
  win.console.error = function(...args) {
91908
91915
  origConsoleError(...args);
91909
- const text3 = args.map((a) => a instanceof Error ? a.message : String(a)).join(" ");
91910
- if (!text3.includes("favicon")) record2([text3]);
91916
+ const text3 = previewConsoleErrorText(args);
91917
+ if (text3 !== null) record2([text3]);
91911
91918
  };
91912
91919
  errorHandler = (e) => record2([e.message || String(e)]);
91913
91920
  win.addEventListener("error", errorHandler);
@@ -96617,9 +96624,9 @@ function useFreshFrameToken(projectId, wanted) {
96617
96624
  useEffect151(() => {
96618
96625
  if (!wanted) return setKnown(void 0);
96619
96626
  let live = true;
96620
- void studioApiFetch(buildProjectApiPath(projectId, "/frame-token")).then((res) => res.ok ? res.json() : null).then(
96621
- (body) => typeof body?.token === "string" ? body.token : null
96622
- ).catch(() => null).then((token) => live && setKnown({ token }));
96627
+ void fetchFrameToken(buildProjectApiPath(projectId, "/frame-token")).then(
96628
+ (token) => live && setKnown({ token })
96629
+ );
96623
96630
  return () => {
96624
96631
  live = false;
96625
96632
  };
@@ -99527,6 +99534,7 @@ var RenderQueuePanel = memo59(function RenderQueuePanel2() {
99527
99534
  // src/components/panels/SlideshowPanel.tsx
99528
99535
  import { useState as useState161, useEffect as useEffect157, useCallback as useCallback182, useRef as useRef189 } from "react";
99529
99536
  import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
99537
+ import { isTypingTarget as isTypingTarget8 } from "@hyperframes/core/typing-target";
99530
99538
 
99531
99539
  // src/components/panels/SlideshowSubPanels.tsx
99532
99540
  import { useState as useState160, useCallback as useCallback181, useId as useId5 } from "react";
@@ -100199,7 +100207,7 @@ function makeSlideshowNotesController() {
100199
100207
  }
100200
100208
  function isPanelUndoKey(e) {
100201
100209
  if (!(e.metaKey || e.ctrlKey) || e.shiftKey || e.key.toLowerCase() !== "z") return false;
100202
- return !isTypingTarget(e.target);
100210
+ return !isTypingTarget8(e.target);
100203
100211
  }
100204
100212
  function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
100205
100213
  const { editingFile } = useFileManagerContext();
@@ -102406,11 +102414,12 @@ import {
102406
102414
 
102407
102415
  // src/hooks/useKeyframeKeyboard.ts
102408
102416
  import { useEffect as useEffect162, useCallback as useCallback193 } from "react";
102417
+ import { isTypingTarget as isTypingTarget9 } from "@hyperframes/core/typing-target";
102409
102418
  function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
102410
102419
  const handler = useCallback193(
102411
102420
  (e) => {
102412
102421
  if (!enabled || !onAddKeyframe) return;
102413
- if (isTypingTarget(document.activeElement)) return;
102422
+ if (isTypingTarget9(document.activeElement)) return;
102414
102423
  if (!matchesKey(e, "addKeyframe")) return;
102415
102424
  e.preventDefault();
102416
102425
  e.stopImmediatePropagation();
@@ -102666,6 +102675,7 @@ function LinkedSelectionToggle() {
102666
102675
  }
102667
102676
 
102668
102677
  // src/components/TimelineToolbar.tsx
102678
+ import { isTypingTarget as isTypingTarget10 } from "@hyperframes/core/typing-target";
102669
102679
  import { Fragment as Fragment73, jsx as jsx263, jsxs as jsxs209 } from "react/jsx-runtime";
102670
102680
  var NO_KEYFRAME_TOGGLE = {
102671
102681
  state: "none",
@@ -102779,7 +102789,7 @@ var TimelineToolbar = memo63(function TimelineToolbar2({
102779
102789
  useEffect163(() => {
102780
102790
  const onKeyDown = (e) => {
102781
102791
  if (!matchesKey(e, "timelineSnap")) return;
102782
- if (isTypingTarget(e.target)) return;
102792
+ if (isTypingTarget10(e.target)) return;
102783
102793
  const store = usePlayerStore.getState();
102784
102794
  store.setTimelineSnapEnabled(!store.timelineSnapEnabled);
102785
102795
  };
@@ -104789,20 +104799,22 @@ export {
104789
104799
  fieldText,
104790
104800
  findElementBlock,
104791
104801
  flushStudioPendingEdits,
104792
- formatCombo,
104802
+ formatCombo2 as formatCombo,
104793
104803
  formatTime,
104794
104804
  getPersistedRenderSettings,
104795
104805
  getStudioKeys,
104796
104806
  liveTime,
104797
- matchCombo,
104807
+ matchCombo2 as matchCombo,
104798
104808
  menuItemBase,
104799
104809
  mergeStyleIntoTag,
104800
104810
  openAudioGainDialog,
104801
- parseCombo,
104811
+ parseCombo2 as parseCombo,
104802
104812
  parseStyleString,
104803
104813
  persistRenderSettings,
104804
104814
  playSeamTransitionLoop,
104805
104815
  popupSurface,
104816
+ previewEditingClient,
104817
+ previewFrameOpaque,
104806
104818
  resolveDomEditSelection,
104807
104819
  resolveEquidistanceGuides,
104808
104820
  resolveGuideLineRect,
package/dist/keys.d.ts CHANGED
@@ -1 +1,72 @@
1
- export { C as Combo, b as ComboEvent, D as DEFAULT_STUDIO_KEYS, a as StudioKeyAction, S as StudioKeys, m as matchCombo, p as parseCombo } from './keys-B163OjLN.js';
1
+ export { Combo, ComboEvent, matchCombo, parseCombo } from '@hyperframes/core/key-combo';
2
+
3
+ /** Every single-character bare key Studio answers, by action. */
4
+ declare const DEFAULT_STUDIO_KEYS: {
5
+ fullscreen: string;
6
+ split: string;
7
+ record: string;
8
+ addKeyframe: string;
9
+ audioGain: string;
10
+ zoomSelection: string;
11
+ mute: string;
12
+ pause: string;
13
+ shuttleBack: string;
14
+ shuttleForward: string;
15
+ inPoint: string;
16
+ outPoint: string;
17
+ seekToIn: string;
18
+ seekToOut: string;
19
+ selectTool: string;
20
+ razorTool: string;
21
+ selectLeftward: string;
22
+ selectRightward: string;
23
+ exitRazor: string;
24
+ snap: string;
25
+ grid: string;
26
+ timelineSnap: string;
27
+ shortcuts: string;
28
+ playPause: string;
29
+ frameBack: string;
30
+ frameForward: string;
31
+ frameBackTen: string;
32
+ frameForwardTen: string;
33
+ loop: string;
34
+ clearInPoint: string;
35
+ clearOutPoint: string;
36
+ undo: string;
37
+ redo: string;
38
+ redoAlt: string;
39
+ tabCompositions: string;
40
+ tabAssets: string;
41
+ group: string;
42
+ ungroup: string;
43
+ copy: string;
44
+ paste: string;
45
+ cut: string;
46
+ duplicate: string;
47
+ linkToggle: string;
48
+ detachAudio: string;
49
+ deleteLinked: string;
50
+ deleteLinkedAlt: string;
51
+ deleteSelected: string;
52
+ deleteSelectedAlt: string;
53
+ resetKeyframes: string;
54
+ nudgeLeft: string;
55
+ nudgeRight: string;
56
+ nudgeUp: string;
57
+ nudgeDown: string;
58
+ nudgeLeftTen: string;
59
+ nudgeRightTen: string;
60
+ nudgeUpTen: string;
61
+ nudgeDownTen: string;
62
+ captionSelectAll: string;
63
+ pickupClip: string;
64
+ pickupUp: string;
65
+ pickupDown: string;
66
+ pickupDrop: string;
67
+ cancel: string;
68
+ };
69
+ type StudioKeyAction = keyof typeof DEFAULT_STUDIO_KEYS;
70
+ type StudioKeys = Readonly<Record<StudioKeyAction, string>>;
71
+
72
+ export { DEFAULT_STUDIO_KEYS, type StudioKeyAction, type StudioKeys };
package/dist/keys.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import {
2
- DEFAULT_STUDIO_KEYS,
3
- matchCombo,
4
- parseCombo
5
- } from "./chunk-5ZHKYODQ.js";
2
+ DEFAULT_STUDIO_KEYS
3
+ } from "./chunk-USW3YBOG.js";
6
4
  import "./chunk-MLKGABMK.js";
5
+
6
+ // src/keys.ts
7
+ import { matchCombo, parseCombo } from "@hyperframes/core/key-combo";
7
8
  export {
8
9
  DEFAULT_STUDIO_KEYS,
9
10
  matchCombo,
package/dist/player.d.ts CHANGED
@@ -18,6 +18,7 @@ interface PlayerProps {
18
18
  suppressLoadingOverlay?: boolean;
19
19
  loadingUi?: "studio" | "host";
20
20
  noLoadTimeout?: boolean;
21
+ sandboxOrigin?: "opaque";
21
22
  }
22
23
  /**
23
24
  * Renders a composition preview using the <hyperframes-player> web component.
package/dist/player.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Player
3
- } from "./chunk-F6EHWNZU.js";
3
+ } from "./chunk-K3IOYISK.js";
4
4
  import "./chunk-G6FJSL7X.js";
5
- import "./chunk-VHV2ZDKY.js";
5
+ import "./chunk-OOGQ5KCC.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
  export {
8
8
  Player