-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3799b06
commit ebb5a20
Showing
12 changed files
with
108 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from "./components" | ||
export * from "./plugins" | ||
export * from "./resources" | ||
export * from "./state" | ||
export * from "./systems" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import type { Plugin } from "../../plugin" | ||
import { LogicalButtonInput, PhysicalButtonInput } from "../resources" | ||
import { Last } from "../../schedule" | ||
import { resetLogicalButtonInput, resetPhysicalButtonInput } from "../systems/buttonInput" | ||
import { Commands } from "../../commands" | ||
import { resetLogicalButtonInput, resetPhysicalButtonInput } from "../systems" | ||
|
||
export const DefaultPlugin: Plugin = (app) => { | ||
Commands.insertResource(new LogicalButtonInput()) | ||
Commands.insertResource(new PhysicalButtonInput()) | ||
app.addSystem(Last, resetLogicalButtonInput) | ||
app.addSystem(Last, resetPhysicalButtonInput) | ||
app.insertResource(new LogicalButtonInput()) | ||
.insertResource(new PhysicalButtonInput()) | ||
.addSystem(Last, resetLogicalButtonInput) | ||
.addSystem(Last, resetPhysicalButtonInput) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import type { App } from "../../app" | ||
import { Location, type TrainingSlash } from "../state" | ||
import { updateLocationState } from "../systems/location" | ||
import { Startup } from "../../schedule" | ||
import { BasePath } from "../resources/basePath" | ||
import { updateLocationState } from "../systems" | ||
import { PreStartup } from "../../schedule" | ||
import { BasePath } from "../resources" | ||
|
||
export function RouterPlugin(app: App) { | ||
app.insertResource(new BasePath("/")).insertState(Location.windowLocation()).addSystem(Startup, updateLocationState) | ||
app.insertResource(new BasePath("/")) | ||
.insertState(Location.windowLocation()) | ||
.addSystem(PreStartup, updateLocationState) | ||
} | ||
|
||
RouterPlugin.withSettings = (basePath: string, trailingSlash: TrainingSlash, trimIndexHtml: boolean) => (app: App) => { | ||
Location.trimIndexHtml = trimIndexHtml | ||
Location.trailingSlash = trailingSlash | ||
|
||
app.insertResource(new BasePath(basePath)) | ||
.insertState(Location.windowLocation()) | ||
.addSystem(Startup, updateLocationState) | ||
.addSystem(PreStartup, updateLocationState) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class HtmlTitle { | ||
public get title(): string { | ||
return document.title | ||
} | ||
|
||
public set title(value: string) { | ||
document.title = value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from "./basePath" | ||
export * from "./buttonInput" | ||
export * from "./htmlRoot" | ||
export * from "./htmlTitle" | ||
export * from "./time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from "./buttonInput" | ||
export * from "./html" | ||
export * from "./location" |