mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
feat(registry): bring back the video-primitive moves (#3169)
Restores the 208 catalog items reverted after their previews 404'd in production, this time on the payload mechanism rather than the .html files that caused the outage. The generator no longer writes a preview document to docs/public. That writer, and the machinery under it, existed only to produce files the docs host discards, so it is gone rather than bypassed. Items now embed the composition itself via a payload, which is what the previous change already does for the items that were already in the catalog. The variables explorer is parked, not restored: it drove its preview through the same unpublished .html path, so it would have shown an empty frame. Items that declare variables get the live player plus the static variables table, and reconnecting the explorer to payloads is a follow-up.
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
filterVariablesIfAbsent,
|
||||
parseHostVariableValues,
|
||||
readDeclaredDefaults,
|
||||
warnUnknownEnumValues,
|
||||
readRenderOverrides,
|
||||
} from "./getVariables";
|
||||
|
||||
@@ -399,6 +400,12 @@ async function mountCompositionContent(params: {
|
||||
* separate document root so no declared defaults are passed.
|
||||
*/
|
||||
declaredVariableDefaults?: Record<string, unknown>;
|
||||
/**
|
||||
* The element `declaredVariableDefaults` was read from. Carries the full
|
||||
* declaration (option sets, not just defaults) so the out-of-set enum guard
|
||||
* can run on the same merge. Same population rule as the defaults above.
|
||||
*/
|
||||
variableDeclarer?: Element;
|
||||
onDiagnostic?: (payload: {
|
||||
code: string;
|
||||
details: Record<string, string | number | boolean | null | string[]>;
|
||||
@@ -720,6 +727,7 @@ export async function loadExternalCompositions(
|
||||
// dual-carrier contract from #2081) loses its defaults on this lazy
|
||||
// external-load path — see inlineSubCompositions for the fixed path.
|
||||
declaredVariableDefaults: readDeclaredDefaults(doc.documentElement),
|
||||
variableDeclarer: doc.documentElement,
|
||||
onDiagnostic: params.onDiagnostic,
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -752,7 +760,11 @@ export async function loadExternalCompositions(
|
||||
* custom properties from a previous mount are cleared before (re)applying.
|
||||
*/
|
||||
function stashInstanceVariables(
|
||||
params: { host: Element; declaredVariableDefaults?: Record<string, unknown> },
|
||||
params: {
|
||||
host: Element;
|
||||
declaredVariableDefaults?: Record<string, unknown>;
|
||||
variableDeclarer?: Element;
|
||||
},
|
||||
contentNode: Node,
|
||||
runtimeScopeCompositionId: string,
|
||||
): void {
|
||||
@@ -763,6 +775,14 @@ function stashInstanceVariables(
|
||||
...declaredDefaults,
|
||||
...parseHostVariableValues(params.host),
|
||||
};
|
||||
// The sub-comp path never reaches the top-level getVariables(), so the
|
||||
// out-of-set enum guard runs here too, against the same merged values the
|
||||
// instance reads back out of __hfVariablesByComp.
|
||||
warnUnknownEnumValues(
|
||||
params.variableDeclarer ?? (contentNode instanceof Element ? contentNode : null),
|
||||
merged,
|
||||
runtimeScopeCompositionId,
|
||||
);
|
||||
clearAppliedCssVariables(params.host);
|
||||
if (Object.keys(merged).length > 0) {
|
||||
if (!window.__hfVariablesByComp) window.__hfVariablesByComp = {};
|
||||
|
||||
Reference in New Issue
Block a user