Move spread directive to framework library

This commit is contained in:
Danny McGee
2023-10-11 10:28:05 -04:00
parent db9f377f2c
commit a34f31751f
3 changed files with 47 additions and 16 deletions
+2 -16
View File
@@ -1,7 +1,7 @@
import { spread } from "@storyteller/framework";
import { match } from "@storyteller/utility";
import { ElementPart, LitElement, TemplateResult, html, nothing, unsafeCSS } from "lit";
import { LitElement, TemplateResult, html, nothing, unsafeCSS } from "lit";
import { customElement, property } from "lit/decorators.js";
import { Directive, directive } from "lit/directive.js";
import { unsafeSVG } from "lit/directives/unsafe-svg.js";
import fasCircleInfo from "@fortawesome/fontawesome-pro/svgs/solid/circle-info.svg?raw";
@@ -59,17 +59,3 @@ function renderSvg(iconId: string) {
</svg>
`;
}
// TODO: Definitely move this
const spread = directive(class extends Directive {
override render(_: Record<string, string>) {
return nothing;
}
override update(part: ElementPart, [attrs]: [Record<string, string>]) {
for (let [key, value] of Object.entries(attrs)) {
part.element.setAttribute(key, value);
}
return part;
}
});