test: prove TechLog UI migration parity
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
|
||||
import { isStudioGatewayError } from "../../application/ports/studio-gateway-error.ts";
|
||||
import type { StudioGateway } from "../../application/ports/studio-gateway.ts";
|
||||
import type { ResolvePublishedLabel } from "../../domain/public-render-content.ts";
|
||||
import type {
|
||||
WorkingCopy,
|
||||
WorkingCopyInput,
|
||||
@@ -24,6 +25,7 @@ import { useBeforeUnload } from "./components/use-before-unload.ts";
|
||||
type StudioProviderProps = Readonly<{
|
||||
children: ReactNode;
|
||||
createGateway: () => StudioGateway;
|
||||
resolvePublishedLabel?: ResolvePublishedLabel;
|
||||
now?: () => Date;
|
||||
navigate?: (href: string) => void;
|
||||
}>;
|
||||
@@ -41,9 +43,12 @@ function defaultNavigate(href: string): void {
|
||||
window.dispatchEvent(new PopStateEvent("popstate"));
|
||||
}
|
||||
|
||||
const missingPublishedLabel: ResolvePublishedLabel = () => undefined;
|
||||
|
||||
export function StudioProvider({
|
||||
children,
|
||||
createGateway,
|
||||
resolvePublishedLabel = missingPublishedLabel,
|
||||
now = () => new Date("2026-08-14T01:00:00.000Z"),
|
||||
navigate = defaultNavigate,
|
||||
}: StudioProviderProps) {
|
||||
@@ -143,6 +148,7 @@ export function StudioProvider({
|
||||
const value = useMemo<StudioContextValue>(
|
||||
() => ({
|
||||
gateway,
|
||||
resolvePublishedLabel,
|
||||
now,
|
||||
editor,
|
||||
requestAnnouncement,
|
||||
@@ -161,6 +167,7 @@ export function StudioProvider({
|
||||
navigateInternal,
|
||||
now,
|
||||
requestAnnouncement,
|
||||
resolvePublishedLabel,
|
||||
setEditorStatus,
|
||||
updateEditorDraft,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user