@hyperframes/studio 0.5.5 → 0.6.0-alpha.1

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 (74) hide show
  1. package/dist/assets/hyperframes-player-Cd8vYWxP.js +198 -0
  2. package/dist/assets/index-D04_ZoMm.js +107 -0
  3. package/dist/assets/index-UWFaHilT.css +1 -0
  4. package/dist/index.html +2 -2
  5. package/package.json +4 -4
  6. package/src/App.tsx +2621 -170
  7. package/src/components/LintModal.tsx +3 -4
  8. package/src/components/editor/DomEditOverlay.test.ts +241 -0
  9. package/src/components/editor/DomEditOverlay.tsx +1300 -0
  10. package/src/components/editor/MotionPanel.tsx +651 -0
  11. package/src/components/editor/PropertyPanel.test.ts +67 -0
  12. package/src/components/editor/PropertyPanel.tsx +2891 -207
  13. package/src/components/editor/TimelineLayerPanel.test.ts +42 -0
  14. package/src/components/editor/TimelineLayerPanel.tsx +113 -0
  15. package/src/components/editor/colorValue.test.ts +82 -0
  16. package/src/components/editor/colorValue.ts +175 -0
  17. package/src/components/editor/domEditing.test.ts +872 -0
  18. package/src/components/editor/domEditing.ts +993 -0
  19. package/src/components/editor/floatingPanel.test.ts +34 -0
  20. package/src/components/editor/floatingPanel.ts +54 -0
  21. package/src/components/editor/fontAssets.ts +32 -0
  22. package/src/components/editor/fontCatalog.ts +126 -0
  23. package/src/components/editor/gradientValue.test.ts +89 -0
  24. package/src/components/editor/gradientValue.ts +445 -0
  25. package/src/components/editor/manualEditingAvailability.test.ts +120 -0
  26. package/src/components/editor/manualEditingAvailability.ts +60 -0
  27. package/src/components/editor/manualEdits.test.ts +945 -0
  28. package/src/components/editor/manualEdits.ts +1397 -0
  29. package/src/components/editor/manualOffsetDrag.test.ts +140 -0
  30. package/src/components/editor/manualOffsetDrag.ts +307 -0
  31. package/src/components/editor/studioMotion.test.ts +355 -0
  32. package/src/components/editor/studioMotion.ts +632 -0
  33. package/src/components/nle/NLELayout.tsx +27 -4
  34. package/src/components/nle/NLEPreview.tsx +50 -5
  35. package/src/components/renders/RenderQueue.tsx +13 -62
  36. package/src/components/renders/useRenderQueue.ts +6 -30
  37. package/src/components/sidebar/AssetsTab.tsx +3 -4
  38. package/src/components/sidebar/CompositionsTab.test.ts +16 -1
  39. package/src/components/sidebar/CompositionsTab.tsx +117 -45
  40. package/src/components/sidebar/LeftSidebar.tsx +140 -125
  41. package/src/hooks/usePersistentEditHistory.test.ts +256 -0
  42. package/src/hooks/usePersistentEditHistory.ts +337 -0
  43. package/src/icons/SystemIcons.tsx +2 -0
  44. package/src/player/components/CompositionThumbnail.test.ts +19 -0
  45. package/src/player/components/CompositionThumbnail.tsx +50 -13
  46. package/src/player/components/EditModal.tsx +5 -20
  47. package/src/player/components/Player.tsx +18 -2
  48. package/src/player/components/Timeline.test.ts +20 -0
  49. package/src/player/components/Timeline.tsx +103 -21
  50. package/src/player/components/TimelineClip.test.ts +92 -0
  51. package/src/player/components/TimelineClip.tsx +241 -7
  52. package/src/player/components/timelineEditing.test.ts +16 -3
  53. package/src/player/components/timelineEditing.ts +10 -3
  54. package/src/player/hooks/useTimelinePlayer.test.ts +148 -19
  55. package/src/player/hooks/useTimelinePlayer.ts +287 -16
  56. package/src/player/store/playerStore.ts +2 -0
  57. package/src/utils/clipboard.test.ts +89 -0
  58. package/src/utils/clipboard.ts +57 -0
  59. package/src/utils/editHistory.test.ts +244 -0
  60. package/src/utils/editHistory.ts +218 -0
  61. package/src/utils/editHistoryStorage.test.ts +37 -0
  62. package/src/utils/editHistoryStorage.ts +99 -0
  63. package/src/utils/mediaTypes.ts +1 -1
  64. package/src/utils/sourcePatcher.test.ts +128 -1
  65. package/src/utils/sourcePatcher.ts +130 -18
  66. package/src/utils/studioFileHistory.test.ts +156 -0
  67. package/src/utils/studioFileHistory.ts +61 -0
  68. package/src/utils/timelineAssetDrop.test.ts +31 -11
  69. package/src/utils/timelineAssetDrop.ts +22 -2
  70. package/src/utils/timelineInspector.test.ts +79 -0
  71. package/src/utils/timelineInspector.ts +116 -0
  72. package/dist/assets/hyperframes-player-CEnWY28J.js +0 -417
  73. package/dist/assets/index-04Mp2wOn.css +0 -1
  74. package/dist/assets/index-960mgQMI.js +0 -93
@@ -0,0 +1,67 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ buildStrokeStyleUpdates,
4
+ buildStrokeWidthStyleUpdates,
5
+ getClipPathInsetPx,
6
+ getCssFilterFunctionPx,
7
+ inferBoxShadowPreset,
8
+ inferClipPathPreset,
9
+ normalizePanelPxValue,
10
+ setCssFilterFunctionPx,
11
+ } from "./PropertyPanel";
12
+
13
+ describe("PropertyPanel style helpers", () => {
14
+ it("normalizes bounded pixel values without accepting incompatible units", () => {
15
+ expect(normalizePanelPxValue("12", { min: 0, max: 40 })).toBe("12px");
16
+ expect(normalizePanelPxValue("12.50px", { min: 0, max: 40 })).toBe("12.5px");
17
+ expect(normalizePanelPxValue("-8", { min: 0, max: 40 })).toBe("0px");
18
+ expect(normalizePanelPxValue("80px", { min: 0, max: 40 })).toBe("40px");
19
+ expect(normalizePanelPxValue("1.2rem", { min: 0, max: 40 })).toBeNull();
20
+ expect(normalizePanelPxValue("auto", { min: 0, max: 40 })).toBeNull();
21
+ });
22
+
23
+ it("adds, replaces, and removes a named filter function while preserving other filters", () => {
24
+ expect(setCssFilterFunctionPx("none", "blur", 12)).toBe("blur(12px)");
25
+ expect(setCssFilterFunctionPx("brightness(1.08)", "blur", 4.5)).toBe(
26
+ "brightness(1.08) blur(4.5px)",
27
+ );
28
+ expect(setCssFilterFunctionPx("brightness(1.08) blur(12px) saturate(1.2)", "blur", 2)).toBe(
29
+ "brightness(1.08) saturate(1.2) blur(2px)",
30
+ );
31
+ expect(setCssFilterFunctionPx("brightness(1.08) blur(12px)", "blur", 0)).toBe(
32
+ "brightness(1.08)",
33
+ );
34
+ expect(setCssFilterFunctionPx("blur(12px)", "blur", 0)).toBe("none");
35
+ expect(getCssFilterFunctionPx("brightness(1.08) blur(3.5px)", "blur")).toBe(3.5);
36
+ expect(getCssFilterFunctionPx("drop-shadow(0 2px 8px black)", "blur")).toBe(0);
37
+ });
38
+
39
+ it("infers shadow and clip presets without losing custom values", () => {
40
+ expect(inferBoxShadowPreset("none")).toBe("none");
41
+ expect(inferBoxShadowPreset("0 12px 36px rgba(0, 0, 0, 0.28)")).toBe("soft");
42
+ expect(inferBoxShadowPreset("0 2px 4px red")).toBe("custom");
43
+
44
+ expect(inferClipPathPreset(undefined)).toBe("none");
45
+ expect(inferClipPathPreset("inset(12px round 8px)")).toBe("inset");
46
+ expect(inferClipPathPreset("circle(50% at 50% 50%)")).toBe("circle");
47
+ expect(inferClipPathPreset("polygon(0 0, 100% 0, 100% 100%)")).toBe("custom");
48
+ expect(getClipPathInsetPx("inset(12.5px round 8px)")).toBe(12.5);
49
+ expect(getClipPathInsetPx("circle(50% at 50% 50%)")).toBe(0);
50
+ });
51
+
52
+ it("keeps stroke width and style edits visually effective", () => {
53
+ expect(buildStrokeWidthStyleUpdates("3px", "none")).toEqual([
54
+ ["border-width", "3px"],
55
+ ["border-style", "solid"],
56
+ ]);
57
+ expect(buildStrokeWidthStyleUpdates("0px", "none")).toEqual([["border-width", "0px"]]);
58
+ expect(buildStrokeWidthStyleUpdates("3px", "dashed")).toEqual([["border-width", "3px"]]);
59
+
60
+ expect(buildStrokeStyleUpdates("dashed", "0px")).toEqual([
61
+ ["border-style", "dashed"],
62
+ ["border-width", "1px"],
63
+ ]);
64
+ expect(buildStrokeStyleUpdates("none", "4px")).toEqual([["border-style", "none"]]);
65
+ expect(buildStrokeStyleUpdates("solid", "4px")).toEqual([["border-style", "solid"]]);
66
+ });
67
+ });