big updats

This commit is contained in:
Daniel Ledda
2025-12-20 00:10:42 +01:00
parent a93ffff00d
commit 51e44db779
25 changed files with 570 additions and 203 deletions

View File

@@ -1,5 +1,5 @@
import { type InjectionKey, inject } from 'vue';
import useDJSSRContext from "@/useDJSSRContext.ts";
import useDjSSRContext from "@/useDjSSRContext.ts";
export function gid(id: string, doc: (Document | ShadowRoot) | undefined) {
return ((doc ?? document).getElementById(id));
@@ -46,7 +46,7 @@ export function css(strs: TemplateStringsArray, ...vals: string[]) {
export const cssRegistry = Symbol('css-registry') as InjectionKey<Set<string>>;
export function addCSS(key: string, css: string) {
const context = useDJSSRContext();
const context = useDjSSRContext();
if (context && !context.styles[key]) {
context.styles[key] = css;
} else {
@@ -58,21 +58,3 @@ export function addCSS(key: string, css: string) {
}
}
}
/*
export class DJElement extends HTMLElement {
static styles: CSSStyleSheet;
static template: HTMLTemplateElement;
root: ShadowRoot;
constructor() {
super();
const statics = this.constructor as typeof DJElement;
this.root = this.attachShadow({ mode: "open" });
this.root.appendChild(statics.template.content.cloneNode(true));
this.root.adoptedStyleSheets = statics.styles ? [statics.styles] : [];
}
}
*/