@hadoku/ui-shell 0.1.44 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed/index.d.ts +1 -0
- package/dist/embed/index.js +1 -0
- package/dist/embed/mount.d.ts +50 -0
- package/dist/embed/mount.js +117 -0
- package/dist/embed/styles.js +2 -2
- package/dist/embed/vite.d.ts +80 -0
- package/dist/embed/vite.js +99 -0
- package/package.json +6 -2
package/dist/embed/index.d.ts
CHANGED
package/dist/embed/index.js
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The frame's own rules, before the game's sheet: the host is the slot it was mounted in, and the
|
|
4
|
+
* game fills it. A game adds what it needs on top (`:host { position: relative }`, say) in its sheet.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HOST_CSS = ":host { display: block; height: 100%; min-height: 0; }";
|
|
7
|
+
/** What a mount hands `setup`. */
|
|
8
|
+
export interface EmbedSetup<Ctx> {
|
|
9
|
+
el: HTMLElement;
|
|
10
|
+
shadow: ShadowRoot;
|
|
11
|
+
/** The React root's element, already in the shadow root. */
|
|
12
|
+
container: HTMLElement;
|
|
13
|
+
/** The context the mount was called with. */
|
|
14
|
+
ctx: Ctx;
|
|
15
|
+
/** Registers an undo; they run in reverse on unmount, after React has unmounted the game. */
|
|
16
|
+
cleanup(undo: () => void): void;
|
|
17
|
+
}
|
|
18
|
+
export interface EmbedOptions<Ctx extends {
|
|
19
|
+
theme: string;
|
|
20
|
+
}> {
|
|
21
|
+
/** For the refusal of a second mount (`bomberman embed: already mounted …`). */
|
|
22
|
+
name: string;
|
|
23
|
+
/** The stylesheet's URL, beside the entry under the app's base. */
|
|
24
|
+
stylesheet: string;
|
|
25
|
+
/** More CSS for the shadow root, after the stylesheet (a sheet the game otherwise writes to the document). */
|
|
26
|
+
extraCss?: () => string;
|
|
27
|
+
/** The container's class. */
|
|
28
|
+
containerClass: string;
|
|
29
|
+
/** Called before the stylesheet is fetched: start fetching what the first render will need. */
|
|
30
|
+
prefetch?: () => void;
|
|
31
|
+
/** Put `ctx.theme` on the host element, and keep it there as `update` moves it. */
|
|
32
|
+
hostTheme?: boolean;
|
|
33
|
+
/** Hand a click on an in-game `#` link to the game's router, rather than to the host's address bar. */
|
|
34
|
+
followHashLink?: (href: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* The game's page-wide state, set up before the first render. May return a step to run before every
|
|
37
|
+
* render (the first and each `update`), outside React.
|
|
38
|
+
*/
|
|
39
|
+
setup?: (env: EmbedSetup<Ctx>) => ((ctx: Ctx) => void) | void;
|
|
40
|
+
/** The game, for a context. Wrapped in `<StrictMode>`. */
|
|
41
|
+
render: (ctx: Ctx) => ReactNode;
|
|
42
|
+
}
|
|
43
|
+
export interface MountedEmbed<Ctx> {
|
|
44
|
+
update(ctx: Ctx): void;
|
|
45
|
+
unmount(): void;
|
|
46
|
+
}
|
|
47
|
+
/** A game's `mount`. Call once, at module level, and export it as `mount`. */
|
|
48
|
+
export declare function mountEmbed<Ctx extends {
|
|
49
|
+
theme: string;
|
|
50
|
+
}>(options: EmbedOptions<Ctx>): (el: HTMLElement, ctx: Ctx) => Promise<MountedEmbed<Ctx>>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* The game bundle a host page imports (`/<app>/embed/<app>-embed.js`): `mount(el, ctx)` draws the game
|
|
4
|
+
* inside a shadow root on `el` and hands back `{ update, unmount }` — `@wolffm/rooms-protocol`'s
|
|
5
|
+
* `GameBundleModule`. Everything the standalone page gets from owning the document is set up here
|
|
6
|
+
* instead, and taken down again by `unmount`, in reverse:
|
|
7
|
+
*
|
|
8
|
+
* - **Styles** — the one stylesheet the embed build emits (`./vite.ts`), fetched once and adopted by
|
|
9
|
+
* the shadow root (`./styles.ts`), after the frame's own `:host` rules ({@link HOST_CSS}) and with
|
|
10
|
+
* whatever the game adds (`extraCss`).
|
|
11
|
+
* - **The theme on `el` itself** (`hostTheme`), before the styles land, so the host is painted in the
|
|
12
|
+
* host's theme rather than the light default (the build's `hostTheme` option themes `:host` from it).
|
|
13
|
+
* Restored on unmount.
|
|
14
|
+
* - **The game's own page-wide state** (`setup`): its route in memory, its document scope, a socket.
|
|
15
|
+
* Each step hands back its undo through `cleanup`. A step that must run before EVERY render, outside
|
|
16
|
+
* React, is what `setup` returns: a child's effect can run before a parent's, so wiring a transport
|
|
17
|
+
* in an effect is too late.
|
|
18
|
+
* - **Hash links** (`followHashLink`) — an `<a href="#/…">` inside the game would rewrite the host's
|
|
19
|
+
* address bar; a click on one is handed to the game's router instead.
|
|
20
|
+
*
|
|
21
|
+
* ## One mount per page
|
|
22
|
+
*
|
|
23
|
+
* A game's route and sockets are module singletons, exactly as they are standalone, where "one room
|
|
24
|
+
* per page" already holds. A second concurrent mount is refused loudly rather than half-sharing the
|
|
25
|
+
* first's.
|
|
26
|
+
*/
|
|
27
|
+
import { StrictMode } from 'react';
|
|
28
|
+
import { createRoot } from 'react-dom/client';
|
|
29
|
+
import { adoptStyles, fetchStyles } from "./styles.js";
|
|
30
|
+
/**
|
|
31
|
+
* The frame's own rules, before the game's sheet: the host is the slot it was mounted in, and the
|
|
32
|
+
* game fills it. A game adds what it needs on top (`:host { position: relative }`, say) in its sheet.
|
|
33
|
+
*/
|
|
34
|
+
export const HOST_CSS = ':host { display: block; height: 100%; min-height: 0; }';
|
|
35
|
+
/** Put `theme` on the host element. Returns the undo, which restores what was there. */
|
|
36
|
+
function themeHost(el) {
|
|
37
|
+
const before = el.getAttribute('data-theme');
|
|
38
|
+
return {
|
|
39
|
+
set: (theme) => el.setAttribute('data-theme', theme),
|
|
40
|
+
undo: () => (before === null ? el.removeAttribute('data-theme') : el.setAttribute('data-theme', before)),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Hand a click on a `#` link inside `shadow` to `follow`. Returns the undo. */
|
|
44
|
+
function followHashLinks(shadow, follow) {
|
|
45
|
+
const onClick = (event) => {
|
|
46
|
+
if (event.defaultPrevented)
|
|
47
|
+
return;
|
|
48
|
+
const link = event.composedPath().find((node) => node instanceof HTMLAnchorElement);
|
|
49
|
+
const href = link?.getAttribute('href');
|
|
50
|
+
if (href === undefined || href === null || !href.startsWith('#'))
|
|
51
|
+
return;
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
follow(href);
|
|
54
|
+
};
|
|
55
|
+
shadow.addEventListener('click', onClick);
|
|
56
|
+
return () => shadow.removeEventListener('click', onClick);
|
|
57
|
+
}
|
|
58
|
+
/** A game's `mount`. Call once, at module level, and export it as `mount`. */
|
|
59
|
+
export function mountEmbed(options) {
|
|
60
|
+
let active = false;
|
|
61
|
+
return async (el, ctx) => {
|
|
62
|
+
if (active)
|
|
63
|
+
throw new Error(`${options.name} embed: already mounted on this page — unmount it before mounting again`);
|
|
64
|
+
active = true;
|
|
65
|
+
const undo = [];
|
|
66
|
+
const teardown = () => {
|
|
67
|
+
for (const step of undo.reverse())
|
|
68
|
+
step();
|
|
69
|
+
undo.length = 0;
|
|
70
|
+
active = false;
|
|
71
|
+
};
|
|
72
|
+
try {
|
|
73
|
+
const hostTheme = options.hostTheme === true ? themeHost(el) : null;
|
|
74
|
+
if (hostTheme !== null) {
|
|
75
|
+
hostTheme.set(ctx.theme);
|
|
76
|
+
undo.push(hostTheme.undo);
|
|
77
|
+
}
|
|
78
|
+
const shadow = el.shadowRoot ?? el.attachShadow({ mode: 'open' });
|
|
79
|
+
options.prefetch?.();
|
|
80
|
+
const css = [HOST_CSS, await fetchStyles(options.stylesheet), options.extraCss?.() ?? ''].join('\n');
|
|
81
|
+
undo.push(adoptStyles(shadow, css));
|
|
82
|
+
const container = document.createElement('div');
|
|
83
|
+
container.className = options.containerClass;
|
|
84
|
+
shadow.append(container);
|
|
85
|
+
undo.push(() => container.remove());
|
|
86
|
+
const beforeRender = options.setup?.({ el, shadow, container, ctx, cleanup: (step) => undo.push(step) }) ?? undefined;
|
|
87
|
+
if (options.followHashLink !== undefined)
|
|
88
|
+
undo.push(followHashLinks(shadow, options.followHashLink));
|
|
89
|
+
const root = createRoot(container);
|
|
90
|
+
const render = (next) => {
|
|
91
|
+
beforeRender?.(next);
|
|
92
|
+
root.render(_jsx(StrictMode, { children: options.render(next) }));
|
|
93
|
+
};
|
|
94
|
+
undo.push(() => root.unmount());
|
|
95
|
+
render(ctx);
|
|
96
|
+
let mounted = true;
|
|
97
|
+
return {
|
|
98
|
+
update: (next) => {
|
|
99
|
+
if (!mounted)
|
|
100
|
+
return;
|
|
101
|
+
hostTheme?.set(next.theme);
|
|
102
|
+
render(next);
|
|
103
|
+
},
|
|
104
|
+
unmount: () => {
|
|
105
|
+
if (!mounted)
|
|
106
|
+
return;
|
|
107
|
+
mounted = false;
|
|
108
|
+
teardown();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
teardown();
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
package/dist/embed/styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* A game embed's stylesheet, inside a shadow root.
|
|
3
3
|
*
|
|
4
4
|
* The embed build (`../../vite.embed.config.ts`) emits every sheet the app
|
|
5
5
|
* imports as ONE file, `embed/cardtable-embed.css`, with `:root`, `html` and
|
|
@@ -44,6 +44,6 @@ export function adoptStyles(shadow, css) {
|
|
|
44
44
|
export async function fetchStyles(href) {
|
|
45
45
|
const res = await fetch(href, { credentials: 'same-origin' });
|
|
46
46
|
if (!res.ok)
|
|
47
|
-
throw new Error(`
|
|
47
|
+
throw new Error(`embed: ${href} answered ${res.status}`);
|
|
48
48
|
return res.text();
|
|
49
49
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** `:root` / `html` / `body` as a compound's type or pseudo-class → `:host`. */
|
|
2
|
+
export declare function toShadowSelector(selector: string): string;
|
|
3
|
+
/** A bare `[data-theme…]` selector also matches the host carrying it. Idempotent — postcss revisits a changed rule. */
|
|
4
|
+
export declare function withHostTheme(selectors: readonly string[]): string[];
|
|
5
|
+
export interface ShadowRootSelectorsPlugin {
|
|
6
|
+
postcssPlugin: string;
|
|
7
|
+
Rule(rule: {
|
|
8
|
+
selector: string;
|
|
9
|
+
selectors: string[];
|
|
10
|
+
}): void;
|
|
11
|
+
}
|
|
12
|
+
/** The PostCSS plugin that rewrites the document roots, and with `hostTheme` themes the host. */
|
|
13
|
+
export declare function shadowRootSelectors({ hostTheme }?: {
|
|
14
|
+
hostTheme?: boolean;
|
|
15
|
+
}): ShadowRootSelectorsPlugin;
|
|
16
|
+
/** The fixed names the bundle is served under. */
|
|
17
|
+
export declare function embedFiles(app: string): {
|
|
18
|
+
entry: string;
|
|
19
|
+
stylesheet: string;
|
|
20
|
+
};
|
|
21
|
+
export interface OneStylesheetPlugin {
|
|
22
|
+
name: string;
|
|
23
|
+
writeBundle(this: {
|
|
24
|
+
error(message: string): never;
|
|
25
|
+
}, options: unknown, bundle: Record<string, unknown>): void;
|
|
26
|
+
}
|
|
27
|
+
/** Fails the build if the one stylesheet did not come out under its fixed name. */
|
|
28
|
+
export declare function requireOneStylesheet(stylesheet: string): OneStylesheetPlugin;
|
|
29
|
+
export interface EmbedBuildOptions<Warn, Output extends object, Post> {
|
|
30
|
+
/** The app's id: `embed/<app>-embed.js` and `embed/<app>-embed.css`. */
|
|
31
|
+
app: string;
|
|
32
|
+
/** The APP's base, `/<app>/`. */
|
|
33
|
+
base: string;
|
|
34
|
+
/** Default `src/embed/index.tsx`. */
|
|
35
|
+
input?: string;
|
|
36
|
+
/** Theme `:host` from every bare `[data-theme]` rule; pair with `mountEmbed`'s `hostTheme`. */
|
|
37
|
+
hostTheme?: boolean;
|
|
38
|
+
/** More PostCSS plugins, after the shadow-root rewrite. */
|
|
39
|
+
postcssPlugins?: readonly Post[];
|
|
40
|
+
sourcemap?: boolean;
|
|
41
|
+
target?: string;
|
|
42
|
+
chunkSizeWarningLimit?: number;
|
|
43
|
+
onwarn?: Warn;
|
|
44
|
+
/** More of the bundler's output options (cardtable's chunk groups); the file names are the preset's. */
|
|
45
|
+
output?: Output;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The embed build's config. Spread it into `defineConfig`, and put the game's own plugins (React)
|
|
49
|
+
* before `preset.plugins`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function embedBuild<Warn = never, Output extends object = Record<never, never>, Post = never>({ app, base, input, hostTheme, postcssPlugins, sourcemap, target, chunkSizeWarningLimit, onwarn, output, }: EmbedBuildOptions<Warn, Output, Post>): {
|
|
52
|
+
base: string;
|
|
53
|
+
plugins: OneStylesheetPlugin[];
|
|
54
|
+
css: {
|
|
55
|
+
postcss: {
|
|
56
|
+
plugins: (ShadowRootSelectorsPlugin | Post)[];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
build: {
|
|
60
|
+
rollupOptions: {
|
|
61
|
+
preserveEntrySignatures: "exports-only";
|
|
62
|
+
output: Output & {
|
|
63
|
+
entryFileNames: string;
|
|
64
|
+
chunkFileNames: string;
|
|
65
|
+
assetFileNames: (asset: {
|
|
66
|
+
names: readonly string[];
|
|
67
|
+
}) => string;
|
|
68
|
+
};
|
|
69
|
+
onwarn?: (Warn & ({} | null)) | undefined;
|
|
70
|
+
input: string;
|
|
71
|
+
};
|
|
72
|
+
chunkSizeWarningLimit?: number | undefined;
|
|
73
|
+
target?: string | undefined;
|
|
74
|
+
outDir: string;
|
|
75
|
+
emptyOutDir: false;
|
|
76
|
+
sourcemap: boolean;
|
|
77
|
+
cssCodeSplit: false;
|
|
78
|
+
assetsDir: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The embed build: the game bundle a host page imports, as a Vite config preset. Typed structurally,
|
|
3
|
+
* so this package needs no Vite of its own: a game spreads the result into its own `defineConfig`.
|
|
4
|
+
*
|
|
5
|
+
* `dist/embed/<app>-embed.js` is an ES module exporting `mount`; it and `dist/embed/<app>-embed.css`
|
|
6
|
+
* keep those names across builds (the server serves both `no-cache`), and everything else lands
|
|
7
|
+
* content-hashed under `dist/embed/assets/` (served immutable).
|
|
8
|
+
*
|
|
9
|
+
* - **`base` is the APP's, `/<app>/`**, not `/<app>/embed/`: the API and socket bases are read from
|
|
10
|
+
* `BASE_URL`, and they are the app's. The output paths carry the `embed/` themselves, so asset URLs
|
|
11
|
+
* come out as `/<app>/embed/assets/…` — absolute, which is what lets the bundle run on the host's
|
|
12
|
+
* page and still reach the app's paths.
|
|
13
|
+
* - **Runs after the page build, into the same `dist/`, without emptying it.**
|
|
14
|
+
* - **One stylesheet, `cssCodeSplit: false`.** A split sheet is loaded at runtime by a `<link>` Vite
|
|
15
|
+
* appends to `document.head` — the host's page, outside the shadow root, where it would style the
|
|
16
|
+
* host and not the game. One file, fetched and adopted by the shadow root, is the whole mechanism
|
|
17
|
+
* (`./styles.ts`). The build fails if it does not come out as exactly that one file.
|
|
18
|
+
* - **`:root`, `html` and `body` become `:host`.** None of them exists inside a shadow tree, and the
|
|
19
|
+
* fleet's tokens are declared on `:root`. Rewritten at build time so the shipped sheet is the sheet
|
|
20
|
+
* that applies.
|
|
21
|
+
* - **`hostTheme`: every theme also themes `:host`.** After the rewrite `:host` carries the fleet's
|
|
22
|
+
* DEFAULT (light) tokens and the `body` background, and no `[data-theme]` inside the shadow tree can
|
|
23
|
+
* reach the host element. So a bare `[data-theme=x]` also emits `:host([data-theme=x])`, and the
|
|
24
|
+
* mount stamps the theme on the host (`mountEmbed`'s `hostTheme`). Without it the host painted the
|
|
25
|
+
* light background under every theme, a white flash between the sheet's adoption and React's first
|
|
26
|
+
* commit. Cardtable's.
|
|
27
|
+
*/
|
|
28
|
+
/** `:root` / `html` / `body` as a compound's type or pseudo-class → `:host`. */
|
|
29
|
+
export function toShadowSelector(selector) {
|
|
30
|
+
return selector.replace(/:root\b/g, ':host').replace(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g, '$1:host');
|
|
31
|
+
}
|
|
32
|
+
const THEME_SELECTOR = /^\[data-theme(?:=[^\]]+)?\]$/;
|
|
33
|
+
/** A bare `[data-theme…]` selector also matches the host carrying it. Idempotent — postcss revisits a changed rule. */
|
|
34
|
+
export function withHostTheme(selectors) {
|
|
35
|
+
const present = new Set(selectors.map((s) => s.trim()));
|
|
36
|
+
return selectors.flatMap((s) => {
|
|
37
|
+
const host = `:host(${s.trim()})`;
|
|
38
|
+
return THEME_SELECTOR.test(s.trim()) && !present.has(host) ? [s, host] : [s];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** The PostCSS plugin that rewrites the document roots, and with `hostTheme` themes the host. */
|
|
42
|
+
export function shadowRootSelectors({ hostTheme = false } = {}) {
|
|
43
|
+
return {
|
|
44
|
+
postcssPlugin: 'embed-shadow-root-selectors',
|
|
45
|
+
Rule(rule) {
|
|
46
|
+
rule.selector = toShadowSelector(rule.selector);
|
|
47
|
+
if (hostTheme)
|
|
48
|
+
rule.selectors = withHostTheme(rule.selectors);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** The fixed names the bundle is served under. */
|
|
53
|
+
export function embedFiles(app) {
|
|
54
|
+
return { entry: `embed/${app}-embed.js`, stylesheet: `embed/${app}-embed.css` };
|
|
55
|
+
}
|
|
56
|
+
/** Fails the build if the one stylesheet did not come out under its fixed name. */
|
|
57
|
+
export function requireOneStylesheet(stylesheet) {
|
|
58
|
+
return {
|
|
59
|
+
name: 'embed-one-stylesheet',
|
|
60
|
+
writeBundle(_options, bundle) {
|
|
61
|
+
const sheets = Object.keys(bundle).filter((name) => name.endsWith('.css'));
|
|
62
|
+
if (sheets.length !== 1 || sheets[0] !== stylesheet) {
|
|
63
|
+
this.error(`the embed build must emit exactly ${stylesheet}; it emitted ${sheets.join(', ') || 'no stylesheet'}`);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The embed build's config. Spread it into `defineConfig`, and put the game's own plugins (React)
|
|
70
|
+
* before `preset.plugins`.
|
|
71
|
+
*/
|
|
72
|
+
export function embedBuild({ app, base, input = 'src/embed/index.tsx', hostTheme = false, postcssPlugins = [], sourcemap = false, target, chunkSizeWarningLimit, onwarn, output, }) {
|
|
73
|
+
const { entry, stylesheet } = embedFiles(app);
|
|
74
|
+
return {
|
|
75
|
+
base,
|
|
76
|
+
plugins: [requireOneStylesheet(stylesheet)],
|
|
77
|
+
css: { postcss: { plugins: [shadowRootSelectors({ hostTheme }), ...postcssPlugins] } },
|
|
78
|
+
build: {
|
|
79
|
+
outDir: 'dist',
|
|
80
|
+
emptyOutDir: false,
|
|
81
|
+
sourcemap,
|
|
82
|
+
cssCodeSplit: false,
|
|
83
|
+
assetsDir: 'embed/assets',
|
|
84
|
+
...(target === undefined ? {} : { target }),
|
|
85
|
+
...(chunkSizeWarningLimit === undefined ? {} : { chunkSizeWarningLimit }),
|
|
86
|
+
rollupOptions: {
|
|
87
|
+
input,
|
|
88
|
+
...(onwarn === undefined ? {} : { onwarn }),
|
|
89
|
+
preserveEntrySignatures: 'exports-only',
|
|
90
|
+
output: {
|
|
91
|
+
...(output ?? {}),
|
|
92
|
+
entryFileNames: entry,
|
|
93
|
+
chunkFileNames: 'embed/assets/[name]-[hash].js',
|
|
94
|
+
assetFileNames: (asset) => asset.names.some((name) => name.endsWith('.css')) ? stylesheet : 'embed/assets/[name]-[hash][extname]',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/ui-shell",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.46",
|
|
4
|
+
"gitHead": "1e3606fe6ef84d205f62af383b2a248512158e54",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The parts of a game's UI any game keeps: chrome, trim, room shell, embed mount, theme and settings frame, UI scale, usage counting, the sound mixer, motion and generic components. One appId parameterizes its storage keys, events and chat prefix. MIT; imports only react, react-dom and @wolffm/*.",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/embed/index.d.ts",
|
|
23
23
|
"import": "./dist/embed/index.js"
|
|
24
24
|
},
|
|
25
|
+
"./embed/vite": {
|
|
26
|
+
"types": "./dist/embed/vite.d.ts",
|
|
27
|
+
"import": "./dist/embed/vite.js"
|
|
28
|
+
},
|
|
25
29
|
"./trim": {
|
|
26
30
|
"types": "./dist/trim/index.d.ts",
|
|
27
31
|
"import": "./dist/trim/index.js"
|