MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / handleMoveElement

Function handleMoveElement

packages/sdk/src/engine/mutate.ts:337–351  ·  view source on GitHub ↗
(
  parsed: ParsedDocument,
  ids: HfId[],
  x: number,
  y: number,
)

Source from the content-addressed store, hash-verified

335}
336
337function handleMoveElement(
338 parsed: ParsedDocument,
339 ids: HfId[],
340 x: number,
341 y: number,
342): MutationResult {
343 // HF elements are positioned via data-x / data-y (parsed by htmlParser.ts,
344 // emitted by hyperframes generator). CSS left/top is not the convention.
345 const rx = handleSetAttribute(parsed, ids, "data-x", String(x));
346 const ry = handleSetAttribute(parsed, ids, "data-y", String(y));
347 return {
348 forward: [...rx.forward, ...ry.forward],
349 inverse: [...ry.inverse, ...rx.inverse],
350 };
351}
352
353function handleSetText(parsed: ParsedDocument, ids: HfId[], value: string): MutationResult {
354 const result: MutationResult = { forward: [], inverse: [] };

Callers 1

applyOpFunction · 0.85

Calls 1

handleSetAttributeFunction · 0.85

Tested by

no test coverage detected