@hyperframes/studio 0.5.5 → 0.6.0-alpha.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-Cd8vYWxP.js +198 -0
- package/dist/assets/index-UWFaHilT.css +1 -0
- package/dist/assets/index-cPJbxeAk.js +107 -0
- package/dist/index.html +2 -2
- package/package.json +4 -4
- package/src/App.tsx +2621 -170
- package/src/components/LintModal.tsx +3 -4
- package/src/components/editor/DomEditOverlay.test.ts +241 -0
- package/src/components/editor/DomEditOverlay.tsx +1300 -0
- package/src/components/editor/MotionPanel.tsx +651 -0
- package/src/components/editor/PropertyPanel.test.ts +67 -0
- package/src/components/editor/PropertyPanel.tsx +2891 -207
- package/src/components/editor/TimelineLayerPanel.test.ts +42 -0
- package/src/components/editor/TimelineLayerPanel.tsx +113 -0
- package/src/components/editor/colorValue.test.ts +82 -0
- package/src/components/editor/colorValue.ts +175 -0
- package/src/components/editor/domEditing.test.ts +872 -0
- package/src/components/editor/domEditing.ts +993 -0
- package/src/components/editor/floatingPanel.test.ts +34 -0
- package/src/components/editor/floatingPanel.ts +54 -0
- package/src/components/editor/fontAssets.ts +32 -0
- package/src/components/editor/fontCatalog.ts +126 -0
- package/src/components/editor/gradientValue.test.ts +89 -0
- package/src/components/editor/gradientValue.ts +445 -0
- package/src/components/editor/manualEditingAvailability.test.ts +129 -0
- package/src/components/editor/manualEditingAvailability.ts +60 -0
- package/src/components/editor/manualEdits.test.ts +945 -0
- package/src/components/editor/manualEdits.ts +1397 -0
- package/src/components/editor/manualOffsetDrag.test.ts +140 -0
- package/src/components/editor/manualOffsetDrag.ts +307 -0
- package/src/components/editor/studioMotion.test.ts +355 -0
- package/src/components/editor/studioMotion.ts +632 -0
- package/src/components/nle/NLELayout.tsx +27 -4
- package/src/components/nle/NLEPreview.tsx +50 -5
- package/src/components/renders/RenderQueue.tsx +13 -62
- package/src/components/renders/useRenderQueue.ts +6 -30
- package/src/components/sidebar/AssetsTab.tsx +3 -4
- package/src/components/sidebar/CompositionsTab.test.ts +16 -1
- package/src/components/sidebar/CompositionsTab.tsx +117 -45
- package/src/components/sidebar/LeftSidebar.tsx +140 -125
- package/src/hooks/usePersistentEditHistory.test.ts +256 -0
- package/src/hooks/usePersistentEditHistory.ts +337 -0
- package/src/icons/SystemIcons.tsx +2 -0
- package/src/player/components/CompositionThumbnail.test.ts +19 -0
- package/src/player/components/CompositionThumbnail.tsx +50 -13
- package/src/player/components/EditModal.tsx +5 -20
- package/src/player/components/Player.tsx +18 -2
- package/src/player/components/Timeline.test.ts +20 -0
- package/src/player/components/Timeline.tsx +103 -21
- package/src/player/components/TimelineClip.test.ts +92 -0
- package/src/player/components/TimelineClip.tsx +241 -7
- package/src/player/components/timelineEditing.test.ts +16 -3
- package/src/player/components/timelineEditing.ts +10 -3
- package/src/player/hooks/useTimelinePlayer.test.ts +148 -19
- package/src/player/hooks/useTimelinePlayer.ts +287 -16
- package/src/player/store/playerStore.ts +2 -0
- package/src/utils/clipboard.test.ts +89 -0
- package/src/utils/clipboard.ts +57 -0
- package/src/utils/editHistory.test.ts +244 -0
- package/src/utils/editHistory.ts +218 -0
- package/src/utils/editHistoryStorage.test.ts +37 -0
- package/src/utils/editHistoryStorage.ts +99 -0
- package/src/utils/mediaTypes.ts +1 -1
- package/src/utils/sourcePatcher.test.ts +128 -1
- package/src/utils/sourcePatcher.ts +130 -18
- package/src/utils/studioFileHistory.test.ts +156 -0
- package/src/utils/studioFileHistory.ts +61 -0
- package/src/utils/timelineAssetDrop.test.ts +31 -11
- package/src/utils/timelineAssetDrop.ts +22 -2
- package/src/utils/timelineInspector.test.ts +79 -0
- package/src/utils/timelineInspector.ts +116 -0
- package/dist/assets/hyperframes-player-CEnWY28J.js +0 -417
- package/dist/assets/index-04Mp2wOn.css +0 -1
- 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
|
+
});
|