@sigil-dev/grimoire 0.9.10 → 0.9.12

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.
@@ -1,30 +0,0 @@
1
- let headElements: (string | Node)[] = [];
2
-
3
- export function resetHead(): void {
4
- headElements = [];
5
- }
6
-
7
- export function collectHead(): (string | Node)[] {
8
- return headElements;
9
- }
10
-
11
- export function applyHead(): void {
12
- //biome-ignore lint: ChildNode.remove() returns void??? sure typescript
13
- document.querySelectorAll("[data-sigil-head]").forEach((el) => el.remove());
14
- for (const el of headElements) {
15
- if (el instanceof Node) {
16
- const clone = el.cloneNode(true) as HTMLElement;
17
- clone.dataset.sigilHead = "1";
18
- document.head.appendChild(clone);
19
- }
20
- }
21
- }
22
-
23
- export function Head({ children }: { children: string | Node }): Comment {
24
- if (typeof document === "undefined") {
25
- headElements.push(children);
26
- } else if (children instanceof Node) {
27
- (headElements as Node[]).push(children);
28
- }
29
- return document.createComment("head");
30
- }