web: Add changes to make shadow template one tsx element

This commit is contained in:
Daniel Jacobs 2024-07-17 16:17:32 -04:00 committed by Nathan Adams
parent f56c43882f
commit 1275656b9e
3 changed files with 596 additions and 709 deletions

View File

@ -3,7 +3,7 @@ interface Error {
}
interface SVGSVGElement {
xmlns?: string;
"xmlns:xlink"?: string;
scale?: string | number;
}
interface SVGPathElement {
fill?: string;
@ -17,10 +17,7 @@ interface SVGTextElement {
interface SVGCircleElement {
fill?: string;
}
interface SVGUseElement {
"xlink:href"?: string;
}
interface HTMLInputElement {
autoCapitalize?: string;
autoComplete?: string;
autocapitalize?: string;
autocorrect?: string;
}

View File

@ -1,6 +1,6 @@
import type { RuffleHandle, ZipWriter } from "../dist/ruffle_web";
import { createRuffleBuilder } from "./load-ruffle";
import { applyStaticStyles, ruffleShadowTemplate } from "./shadow-template";
import { ruffleShadowTemplate } from "./shadow-template";
import { lookupElement } from "./internal/register-element";
import { DEFAULT_CONFIG } from "./config";
import type { DataLoadOptions, URLLoadOptions } from "./load-options";
@ -119,7 +119,6 @@ class Point {
export class RufflePlayer extends HTMLElement {
private readonly shadow: ShadowRoot;
private readonly dynamicStyles: HTMLStyleElement;
private readonly staticStyles: HTMLStyleElement;
private readonly container: HTMLElement;
private readonly playButton: HTMLElement;
private readonly unmuteOverlay: HTMLElement;
@ -231,9 +230,6 @@ export class RufflePlayer extends HTMLElement {
this.dynamicStyles = this.shadow.getElementById(
"dynamic-styles",
) as HTMLStyleElement;
this.staticStyles = this.shadow.getElementById(
"static-styles",
) as HTMLStyleElement;
this.container = this.shadow.getElementById("container")!;
this.playButton = this.shadow.getElementById("play-button")!;
this.playButton.addEventListener("click", () => this.play());
@ -529,7 +525,6 @@ export class RufflePlayer extends HTMLElement {
*/
connectedCallback(): void {
this.updateStyles();
applyStaticStyles(this.staticStyles);
}
/**

File diff suppressed because it is too large Load Diff