@hyperframes/studio 0.8.205 → 0.8.207

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 (51) hide show
  1. package/dist/assets/hyperframes-player-Cm5aBiKq.js +478 -0
  2. package/dist/assets/{index-dy6GQJn4.js → index-BF9YeBnC.js} +142 -142
  3. package/dist/assets/{index-C8hp9Y7c.js → index-BrqAmMRt.js} +1 -1
  4. package/dist/{chunk-Z5NKM57J.js → chunk-3EAFE522.js} +8 -4
  5. package/dist/{chunk-2YCKGJFD.js → chunk-HPIJDMWG.js} +5 -5
  6. package/dist/{chunk-T43DM7Q6.js → chunk-OGIOFEC7.js} +4 -2
  7. package/dist/{domEditingLayers-WMDSHU5P.js → domEditingLayers-7Z6J4UOK.js} +2 -2
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.html +1 -1
  10. package/dist/index.js +235 -127
  11. package/dist/player.js +2 -2
  12. package/package.json +8 -8
  13. package/src/components/MediaPreview.test.tsx +69 -0
  14. package/src/components/MediaPreview.tsx +10 -5
  15. package/src/components/editor/domEditLayerWalkCache.test.ts +48 -0
  16. package/src/components/editor/domEditLayerWalkCache.ts +6 -0
  17. package/src/components/editor/domEditingLayers.ts +3 -2
  18. package/src/components/sidebar/PromptPreviewModal.test.tsx +22 -0
  19. package/src/components/sidebar/PromptPreviewModal.tsx +1 -0
  20. package/src/hooks/timelineEditingHelpers.test.ts +59 -0
  21. package/src/hooks/timelineEditingHelpers.ts +4 -5
  22. package/src/hooks/useGestureRecording.ts +5 -3
  23. package/src/player/components/PlayerControls.tsx +5 -2
  24. package/src/player/components/ShortcutsPanel.tsx +4 -2
  25. package/src/player/components/Timeline.test.ts +12 -0
  26. package/src/player/components/TimelineProvider.tsx +1 -0
  27. package/src/player/components/TimelineRuler.tsx +4 -7
  28. package/src/player/components/TimelineRulerPart.tsx +1 -0
  29. package/src/player/components/timelineClipDragPreview.test.ts +10 -0
  30. package/src/player/components/timelineClipDragPreview.ts +4 -5
  31. package/src/player/components/timelineRulerGeometry.ts +14 -3
  32. package/src/player/components/useTimelineClipDrag.ts +5 -2
  33. package/src/player/components/useTimelineProviderState.tsx +2 -1
  34. package/src/player/components/useTimelineTicks.ts +4 -1
  35. package/src/player/hooks/previewMessageRouter.test.ts +34 -0
  36. package/src/player/hooks/previewMessageRouter.ts +14 -3
  37. package/src/player/hooks/usePlaybackKeyboard.test.ts +19 -0
  38. package/src/player/hooks/usePlaybackKeyboard.ts +5 -2
  39. package/src/player/hooks/useShadowPreviewReload.ts +4 -1
  40. package/src/player/hooks/useTimelinePlayer.shadowReload.test.ts +21 -0
  41. package/src/player/lib/mediaFetch.test.ts +163 -0
  42. package/src/player/lib/mediaFetch.ts +98 -0
  43. package/src/player/lib/mediaProbe.test.ts +21 -1
  44. package/src/player/lib/mediaProbe.ts +4 -2
  45. package/src/player/lib/thumbnailVideoDecoder.test.ts +24 -1
  46. package/src/player/lib/thumbnailVideoDecoder.ts +3 -1
  47. package/src/player/lib/time.test.ts +13 -13
  48. package/src/player/lib/time.ts +4 -4
  49. package/src/utils/linkedClipPreferences.ts +2 -0
  50. package/src/utils/sourceScopedSelectorIndex.ts +5 -2
  51. package/dist/assets/hyperframes-player-DzdSmJdB.js +0 -478
@@ -1,4 +1,4 @@
1
- import{n as Qi}from"./index-dy6GQJn4.js";/*!
1
+ import{n as Qi}from"./index-BF9YeBnC.js";/*!
2
2
  * Copyright (c) 2026-present, Vanilagy and contributors
3
3
  *
4
4
  * This Source Code Form is subject to the terms of the Mozilla Public
@@ -19,7 +19,7 @@ import {
19
19
  querySelectorAllSafely,
20
20
  studioApiFetch,
21
21
  withSelectorIndexPass
22
- } from "./chunk-T43DM7Q6.js";
22
+ } from "./chunk-OGIOFEC7.js";
23
23
 
24
24
  // src/components/editor/domEditingLayers.ts
25
25
  import { isClipHiddenByRuntime, PREVIEW_ONLY_ATTRS } from "@hyperframes/core/studio-preview-mark";
@@ -349,9 +349,11 @@ function createDomEditLayerWalkCache() {
349
349
  let presence = /* @__PURE__ */ new WeakMap();
350
350
  let identities = /* @__PURE__ */ new WeakMap();
351
351
  let scope = null;
352
+ const selectorIndex = /* @__PURE__ */ new Map();
352
353
  const invalidateAll = () => {
353
354
  presence = /* @__PURE__ */ new WeakMap();
354
355
  identities = /* @__PURE__ */ new WeakMap();
356
+ selectorIndex.clear();
355
357
  };
356
358
  const drop = (el) => {
357
359
  if (el) presence.delete(el);
@@ -425,7 +427,8 @@ function createDomEditLayerWalkCache() {
425
427
  }
426
428
  }
427
429
  },
428
- invalidateAll
430
+ invalidateAll,
431
+ selectorIndex
429
432
  };
430
433
  }
431
434
  function readDomEditLayerWalkEntry(el, activeCompositionPath, cache) {
@@ -749,9 +752,10 @@ function collectDomEditLayerItems(root, options, maxItems = Number.POSITIVE_INFI
749
752
  if (items.length >= maxItems) return;
750
753
  }
751
754
  };
752
- withSelectorIndexPass(root.ownerDocument, () => {
755
+ const walkRoots = () => {
753
756
  for (const el of groupScopedLayerRoots(root, options.activeGroupElement ?? null)) visit(el, 0);
754
- });
757
+ };
758
+ withSelectorIndexPass(root.ownerDocument, walkRoots, cache?.selectorIndex);
755
759
  return items;
756
760
  }
757
761
  function liveLayerElement(layer, doc, activeCompositionPath) {
@@ -5,7 +5,7 @@ import {
5
5
  buildProjectApiPath,
6
6
  splitTimelineElementKey,
7
7
  studioApiFetch
8
- } from "./chunk-T43DM7Q6.js";
8
+ } from "./chunk-OGIOFEC7.js";
9
9
 
10
10
  // src/player/lib/time.ts
11
11
  var STUDIO_PREVIEW_FPS = 30;
@@ -16,22 +16,22 @@ function formatTime(time) {
16
16
  const secs = Math.floor(time % 60);
17
17
  return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
18
18
  }
19
- function secondsToFrame(time, fps = STUDIO_PREVIEW_FPS) {
19
+ function secondsToFrame(time, fps) {
20
20
  if (!Number.isFinite(time) || time <= 0) return 0;
21
21
  if (!Number.isFinite(fps) || fps <= 0) return 0;
22
22
  return Math.round(time * fps);
23
23
  }
24
- function frameToSeconds(frame, fps = STUDIO_PREVIEW_FPS) {
24
+ function frameToSeconds(frame, fps) {
25
25
  if (!Number.isFinite(frame) || frame <= 0) return 0;
26
26
  if (!Number.isFinite(fps) || fps <= 0) return 0;
27
27
  return frame / fps;
28
28
  }
29
- function stepFrameTime(time, deltaFrames, fps = STUDIO_PREVIEW_FPS) {
29
+ function stepFrameTime(time, deltaFrames, fps) {
30
30
  const currentFrame = secondsToFrame(time, fps);
31
31
  const nextFrame = Math.max(0, currentFrame + deltaFrames);
32
32
  return frameToSeconds(nextFrame, fps);
33
33
  }
34
- function formatFrameTime(time, duration, fps = STUDIO_PREVIEW_FPS) {
34
+ function formatFrameTime(time, duration, fps) {
35
35
  const currentFrame = secondsToFrame(time, fps);
36
36
  const totalFrames = secondsToFrame(duration, fps);
37
37
  return `${currentFrame}f / ${totalFrames}f`;
@@ -4,9 +4,11 @@ import {
4
4
 
5
5
  // src/utils/sourceScopedSelectorIndex.ts
6
6
  var activePass = null;
7
- function withSelectorIndexPass(doc, run) {
7
+ function withSelectorIndexPass(doc, run, kept) {
8
8
  const previous = activePass;
9
- activePass = { doc, bySelector: /* @__PURE__ */ new Map() };
9
+ const bySelector = kept?.get(doc) ?? /* @__PURE__ */ new Map();
10
+ kept?.set(doc, bySelector);
11
+ activePass = { doc, bySelector };
10
12
  try {
11
13
  return run();
12
14
  } finally {
@@ -19,8 +19,8 @@ import {
19
19
  resolveDomEditCapabilities,
20
20
  resolveDomEditSelection,
21
21
  serializeDomEditTextFields
22
- } from "./chunk-Z5NKM57J.js";
23
- import "./chunk-T43DM7Q6.js";
22
+ } from "./chunk-3EAFE522.js";
23
+ import "./chunk-OGIOFEC7.js";
24
24
  import "./chunk-MLKGABMK.js";
25
25
  export {
26
26
  buildDefaultDomEditTextField,
package/dist/index.d.ts CHANGED
@@ -1735,6 +1735,7 @@ type TimelineCanvasState = Omit<TimelineLaneBaseProps, "setRangeSelection" | "se
1735
1735
  totalH: number;
1736
1736
  effectiveDuration: number;
1737
1737
  majorTickInterval: number;
1738
+ tickFrameRate: number | undefined;
1738
1739
  rangeSelection: TimelineRangeSelection | null;
1739
1740
  marqueeRect: Rect$1 | null;
1740
1741
  resizingClip: ResizingClipState | null;
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-dy6GQJn4.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-BF9YeBnC.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-CYbvOVp-.css">
19
19
  </head>
20
20
  <body>