@hyperframes/studio 0.8.70 → 0.8.72
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-CYdwxTwz.js → hyperframes-player-jTC1EDAI.js} +1 -1
- package/dist/assets/{index-BBOktYKC.css → index-0w6iIlwZ.css} +1 -1
- package/dist/assets/{index-Egnc_kWw.js → index-BqUGSWqN.js} +176 -176
- package/dist/assets/{index-D7hgjzBq.js → index-DpVD1igA.js} +1 -1
- package/dist/assets/{index-BPafHV3q.js → index-HuYqM2Fi.js} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.html +2 -2
- package/dist/index.js +834 -780
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -7
- package/src/App.tsx +5 -0
- package/src/components/CompositionMissingBanner.test.tsx +35 -0
- package/src/components/CompositionMissingBanner.tsx +32 -0
- package/src/components/nle/NLEPreview.test.ts +19 -1
- package/src/components/nle/NLEPreview.tsx +22 -7
- package/src/hooks/useExternalFileChangeCoordinator.test.tsx +36 -1
- package/src/hooks/useExternalFileChangeCoordinator.ts +19 -1
- package/src/hooks/useSdkSession.lifecycle.test.tsx +146 -0
- package/src/hooks/useSdkSession.ts +56 -8
- package/src/hooks/useStudioExternalFileChanges.ts +2 -0
- package/src/hooks/useStudioSdkSessions.ts +2 -0
- package/src/player/components/VolumeControl.styles.test.ts +1 -1
- package/src/player/components/timelineMotionStyles.test.ts +1 -1
- package/src/styles/componentStyles.test.ts +35 -0
- package/src/styles/components.css +843 -0
- package/src/styles/hex-baseline.json +1 -1
- package/src/styles/studio.css +1 -841
- package/src/styles/tokenGate.test.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
|
|
4
|
-
const studioCss = readFileSync(new URL("../../styles/
|
|
4
|
+
const studioCss = readFileSync(new URL("../../styles/components.css", import.meta.url), "utf8");
|
|
5
5
|
const themeCss = readFileSync(new URL("../../styles/theme.css", import.meta.url), "utf8");
|
|
6
6
|
const timelineOverlaySources = [
|
|
7
7
|
"TimelineShortcutHint.tsx",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Guards the split between Studio's app sheet and the component rules an embedder imports. */
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { compile } from "tailwindcss";
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { loadStylesheet, STYLES_DIR } from "./styleSources";
|
|
8
|
+
|
|
9
|
+
/** Class names in a stylesheet's selectors, at any nesting depth (inside @layer or @media too). */
|
|
10
|
+
function selectorClasses(css: string): string[] {
|
|
11
|
+
const source = css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/@(?:import|source)[^;]*;/g, "");
|
|
12
|
+
return [...source.matchAll(/([^{};]+)\{/g)]
|
|
13
|
+
.map((match) => match[1].trim())
|
|
14
|
+
.filter((prelude) => !prelude.startsWith("@"))
|
|
15
|
+
.flatMap((selector) => [...selector.matchAll(/\.(-?[_a-zA-Z][\w-]*)/g)].map((m) => m[1]));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe("studio component styles", () => {
|
|
19
|
+
it("keeps class rules out of the app sheet, where an embedder never sees them", () => {
|
|
20
|
+
const appSheet = readFileSync(path.join(STYLES_DIR, "studio.css"), "utf8");
|
|
21
|
+
|
|
22
|
+
expect(selectorClasses(appSheet), "move these rules to components.css").toEqual([]);
|
|
23
|
+
expect(
|
|
24
|
+
selectorClasses(readFileSync(path.join(STYLES_DIR, "components.css"), "utf8")),
|
|
25
|
+
).toContain("timeline-clip__label");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("gives an embedder the timeline rules from theme.css and components.css alone", async () => {
|
|
29
|
+
const entry = '@import "tailwindcss";\n@import "./theme.css";\n@import "./components.css";';
|
|
30
|
+
const css = (await compile(entry, { base: STYLES_DIR, loadStylesheet })).build([]);
|
|
31
|
+
|
|
32
|
+
expect(css).toMatch(/^\s*\.timeline-clip__label \{/m);
|
|
33
|
+
expect(css).not.toContain("#root");
|
|
34
|
+
});
|
|
35
|
+
});
|