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

Function buildAttributeSection

packages/sdk-playground/src/main.ts:870–889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

868}
869
870function buildAttributeSection(): HTMLDivElement {
871 const name = mkInput("name", "data-custom");
872 name.style.width = "110px";
873 const val = mkInput("value", "hello");
874 val.style.width = "100px";
875 const set = mkBtn("Set attr", "primary", () => {
876 if (!needSelection()) return;
877 comp!.element(selectedId!).setAttribute(name.value.trim(), val.value.trim() || null);
878 logEntry("op", { setAttribute: { id: selectedId, name: name.value, value: val.value } });
879 });
880 const remove = mkBtn("Remove el", "danger", () => {
881 if (!needSelection()) return;
882 removeSelected();
883 });
884 return opSection(
885 "setAttribute / removeElement",
886 opRow(mkNote("operates on selected element")),
887 opRow(name, val, set, remove),
888 );
889}
890
891function buildVariableSection(): HTMLDivElement {
892 const id = mkInput("variable id", "brand-color");

Callers

nothing calls this directly

Calls 10

mkInputFunction · 0.85
mkBtnFunction · 0.85
needSelectionFunction · 0.85
logEntryFunction · 0.85
removeSelectedFunction · 0.85
opSectionFunction · 0.85
opRowFunction · 0.85
mkNoteFunction · 0.85
setAttributeMethod · 0.65
elementMethod · 0.65

Tested by

no test coverage detected