documentation/components/source/playground-link.ts
1/** Relative to the built component asset, so the static site can live below a path. */
2export function playgroundURL(
3 kind?: "edit" | "snapshot",
4 payload?: string,
5): URL {
6 const url = new URL("../playground/index.html", import.meta.url);
7 if (kind && payload) url.hash = `${kind}=${payload}`;
8 return url;
9}