@novely/solid-renderer 0.52.0 → 0.54.0
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/index.d.ts +152 -1
- package/dist/index.js +2402 -0
- package/dist/index.js.map +1 -0
- package/dist/{styles/index.css → style.css} +253 -243
- package/package.json +13 -12
- package/dist/actions.d.ts +0 -2
- package/dist/components/Await.d.ts +0 -7
- package/dist/components/Canvas.d.ts +0 -9
- package/dist/components/Character.d.ts +0 -8
- package/dist/components/ControlPanelButtons.d.ts +0 -10
- package/dist/components/DialogName.d.ts +0 -8
- package/dist/components/DialogOverview.d.ts +0 -14
- package/dist/components/Icon.d.ts +0 -7
- package/dist/components/Modal.d.ts +0 -11
- package/dist/components/Range.d.ts +0 -14
- package/dist/components/Root.d.ts +0 -23
- package/dist/components/Save.d.ts +0 -11
- package/dist/components/Select.d.ts +0 -14
- package/dist/components/Typewriter.d.ts +0 -14
- package/dist/components/index.d.ts +0 -13
- package/dist/constants.d.ts +0 -7
- package/dist/context/index.d.ts +0 -38
- package/dist/context-state.d.ts +0 -9
- package/dist/custom-actions/index.d.ts +0 -2
- package/dist/custom-actions/mood.d.ts +0 -3
- package/dist/custom-actions/show-hide-image.d.ts +0 -25
- package/dist/emitter.d.ts +0 -12
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useMedia.d.ts +0 -2
- package/dist/index.jsx +0 -5487
- package/dist/renderer.d.ts +0 -79
- package/dist/screens/custom-screen.d.ts +0 -9
- package/dist/screens/game.d.ts +0 -14
- package/dist/screens/index.d.ts +0 -6
- package/dist/screens/loading.d.ts +0 -6
- package/dist/screens/mainmenu.d.ts +0 -3
- package/dist/screens/saves.d.ts +0 -3
- package/dist/screens/settings.d.ts +0 -6
- package/dist/shared.d.ts +0 -3
- package/dist/types.d.ts +0 -50
- package/dist/utils.d.ts +0 -27
package/dist/renderer.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { Character, Context, Lang, RendererInit } from '@novely/core';
|
|
2
|
-
import type { CreateSolidRendererOptions, EmitterEventsMap, SolidRendererStore, StateMainmenuItem, StateScreen, StateScreens } from './types';
|
|
3
|
-
declare const createRenderer: ({ fullscreen, controls, target, showAudioSettings, }?: CreateSolidRendererOptions) => {
|
|
4
|
-
emitter: import("./emitter").Emitter<EmitterEventsMap>;
|
|
5
|
-
renderer<$Language extends Lang, $Characters extends Record<string, Character<$Language>>>(options: RendererInit<$Language, $Characters>): {
|
|
6
|
-
getContext: (key: string) => Context;
|
|
7
|
-
removeContext(name: string): void;
|
|
8
|
-
ui: {
|
|
9
|
-
showScreen(name: import("@novely/core").NovelyScreen): void;
|
|
10
|
-
getScreen(): import("@novely/core").NovelyScreen;
|
|
11
|
-
showLoading(): void;
|
|
12
|
-
hideLoading(): void;
|
|
13
|
-
showExitPrompt(): void;
|
|
14
|
-
start: () => {
|
|
15
|
-
unmount: () => void;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
misc: {
|
|
19
|
-
preloadImage: <T extends string>(src: T) => T;
|
|
20
|
-
preloadImageBlocking: (src: string) => Promise<void>;
|
|
21
|
-
preloadAudioBlocking: (source: string) => Promise<void>;
|
|
22
|
-
};
|
|
23
|
-
actions: {
|
|
24
|
-
showImage: (asset: import("@novely/core").NovelyAsset, { classesBase, classesIn, wait }?: {
|
|
25
|
-
classesBase?: string;
|
|
26
|
-
classesIn?: string;
|
|
27
|
-
wait?: boolean;
|
|
28
|
-
}) => import("@novely/core").ValidAction;
|
|
29
|
-
hideImage: (asset: import("@novely/core").NovelyAsset, { classesOut, wait }?: {
|
|
30
|
-
classesOut?: string;
|
|
31
|
-
wait?: boolean;
|
|
32
|
-
}) => import("@novely/core").ValidAction;
|
|
33
|
-
setMood: (mood: string | import("@novely/core").TextContent<Lang, import("@novely/core").State>) => import("@novely/core").ValidAction;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
registerScreen(name: string, screen: StateScreen): void;
|
|
37
|
-
registerMainmenuItem(fn: StateMainmenuItem): void;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated import `createRenderer` instead
|
|
41
|
-
*/
|
|
42
|
-
export declare const createSolidRenderer: ({ fullscreen, controls, target, showAudioSettings, }?: CreateSolidRendererOptions) => {
|
|
43
|
-
emitter: import("./emitter").Emitter<EmitterEventsMap>;
|
|
44
|
-
renderer<$Language extends Lang, $Characters extends Record<string, Character<$Language>>>(options: RendererInit<$Language, $Characters>): {
|
|
45
|
-
getContext: (key: string) => Context;
|
|
46
|
-
removeContext(name: string): void;
|
|
47
|
-
ui: {
|
|
48
|
-
showScreen(name: import("@novely/core").NovelyScreen): void;
|
|
49
|
-
getScreen(): import("@novely/core").NovelyScreen;
|
|
50
|
-
showLoading(): void;
|
|
51
|
-
hideLoading(): void;
|
|
52
|
-
showExitPrompt(): void;
|
|
53
|
-
start: () => {
|
|
54
|
-
unmount: () => void;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
misc: {
|
|
58
|
-
preloadImage: <T extends string>(src: T) => T;
|
|
59
|
-
preloadImageBlocking: (src: string) => Promise<void>;
|
|
60
|
-
preloadAudioBlocking: (source: string) => Promise<void>;
|
|
61
|
-
};
|
|
62
|
-
actions: {
|
|
63
|
-
showImage: (asset: import("@novely/core").NovelyAsset, { classesBase, classesIn, wait }?: {
|
|
64
|
-
classesBase?: string;
|
|
65
|
-
classesIn?: string;
|
|
66
|
-
wait?: boolean;
|
|
67
|
-
}) => import("@novely/core").ValidAction;
|
|
68
|
-
hideImage: (asset: import("@novely/core").NovelyAsset, { classesOut, wait }?: {
|
|
69
|
-
classesOut?: string;
|
|
70
|
-
wait?: boolean;
|
|
71
|
-
}) => import("@novely/core").ValidAction;
|
|
72
|
-
setMood: (mood: string | import("@novely/core").TextContent<Lang, import("@novely/core").State>) => import("@novely/core").ValidAction;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
registerScreen(name: string, screen: StateScreen): void;
|
|
76
|
-
registerMainmenuItem(fn: StateMainmenuItem): void;
|
|
77
|
-
};
|
|
78
|
-
export { createRenderer };
|
|
79
|
-
export type { StateScreen, StateScreens, SolidRendererStore };
|
package/dist/screens/game.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Context } from '@novely/core';
|
|
2
|
-
import type { VoidComponent } from 'solid-js';
|
|
3
|
-
import type { IContextState } from '../context-state';
|
|
4
|
-
import type { SolidRendererStore } from '../renderer';
|
|
5
|
-
type GameProps = {
|
|
6
|
-
context: Context;
|
|
7
|
-
$contextState: IContextState;
|
|
8
|
-
store: SolidRendererStore;
|
|
9
|
-
controls: 'inside' | 'outside';
|
|
10
|
-
isPreview?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
declare const Game: VoidComponent<GameProps>;
|
|
14
|
-
export { Game };
|
package/dist/screens/index.d.ts
DELETED
package/dist/screens/saves.d.ts
DELETED
package/dist/shared.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { CharacterHandle, NovelyScreen } from '@novely/core';
|
|
2
|
-
import type { JSX } from 'solid-js';
|
|
3
|
-
import type { MountableElement } from 'solid-js/web';
|
|
4
|
-
type StateScreen = () => {
|
|
5
|
-
mount(): Element | JSX.Element;
|
|
6
|
-
unmount?(): void;
|
|
7
|
-
};
|
|
8
|
-
type StateScreens = Record<string, StateScreen>;
|
|
9
|
-
type PossibleScreen = NovelyScreen | (string & Record<never, never>);
|
|
10
|
-
type StateMainmenuItem = (goto: (name: PossibleScreen) => void) => JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
11
|
-
type StateMainmenuItems = StateMainmenuItem[];
|
|
12
|
-
type CustomCharacterHandle = CharacterHandle & {
|
|
13
|
-
/**
|
|
14
|
-
* Node in which character is rendered
|
|
15
|
-
*/
|
|
16
|
-
element: HTMLDivElement;
|
|
17
|
-
};
|
|
18
|
-
type SolidRendererStore = {
|
|
19
|
-
characters: Record<string, CustomCharacterHandle>;
|
|
20
|
-
};
|
|
21
|
-
type CreateSolidRendererOptions = {
|
|
22
|
-
/**
|
|
23
|
-
* Enter fullscreen mode when opening a game, exit when opening main-menu
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
fullscreen?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Controls position
|
|
29
|
-
* @default "outside"
|
|
30
|
-
*/
|
|
31
|
-
controls?: 'inside' | 'outside';
|
|
32
|
-
/**
|
|
33
|
-
* Where Novely will be mounted
|
|
34
|
-
* @default document.body
|
|
35
|
-
*/
|
|
36
|
-
target?: MountableElement;
|
|
37
|
-
/**
|
|
38
|
-
* Show audio settings in settings menu?
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
showAudioSettings?: boolean;
|
|
42
|
-
};
|
|
43
|
-
type EmitterEventsMap = {
|
|
44
|
-
'screen:change': PossibleScreen;
|
|
45
|
-
};
|
|
46
|
-
type RendererStoreExtension = {
|
|
47
|
-
screens: Record<string, StateScreen>;
|
|
48
|
-
mainmenu: StateMainmenuItems;
|
|
49
|
-
};
|
|
50
|
-
export type { EmitterEventsMap, StateScreen, StateScreens, PossibleScreen, StateMainmenuItem, StateMainmenuItems, SolidRendererStore, CreateSolidRendererOptions, RendererStoreExtension, CustomCharacterHandle, };
|
package/dist/utils.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Stored } from '@novely/core';
|
|
2
|
-
import type { Atom } from '@novely/renderer-toolkit';
|
|
3
|
-
declare const capitalize: (str: string) => string;
|
|
4
|
-
declare const isCSSImage: (str: string) => boolean;
|
|
5
|
-
declare const createImageSync: (src: string) => HTMLImageElement;
|
|
6
|
-
declare const createImage: (src: string) => Promise<HTMLImageElement | null>;
|
|
7
|
-
declare const waitForImage: (image: HTMLImageElement) => Promise<boolean>;
|
|
8
|
-
/**
|
|
9
|
-
* Draws passed `images` array on a `canvas`
|
|
10
|
-
*/
|
|
11
|
-
declare const canvasDrawImages: (canvas: HTMLCanvasElement | undefined, ctx: CanvasRenderingContext2D | undefined, images: HTMLImageElement[]) => Promise<readonly [HTMLCanvasElement, CanvasRenderingContext2D]>;
|
|
12
|
-
declare const url: <T extends string>(str: T) => `url(${T})`;
|
|
13
|
-
declare const onKey: (cb: (event: KeyboardEvent) => void, ...keys: string[]) => (e: KeyboardEvent) => void;
|
|
14
|
-
declare const simple: <T extends unknown[], R>(fn: (...args: T) => R) => (...args: T) => R;
|
|
15
|
-
declare const getDocumentStyles: () => string;
|
|
16
|
-
/**
|
|
17
|
-
* A wrapper on `fn` to make it run only once!
|
|
18
|
-
* @param fn Function that needed to run no more than one time
|
|
19
|
-
*/
|
|
20
|
-
declare const once: (fn: () => void) => () => void;
|
|
21
|
-
declare const createRetrieved: <T>(fn: () => T) => () => T;
|
|
22
|
-
/**
|
|
23
|
-
* Like solid-js's from, but has initial value
|
|
24
|
-
*/
|
|
25
|
-
declare const from: <T>(producer: Atom<T> | Stored<T>) => import("solid-js").Accessor<T>;
|
|
26
|
-
declare const removeTagsFromHTML: (html: string) => string;
|
|
27
|
-
export { createRetrieved, isCSSImage, canvasDrawImages, url, capitalize, onKey, simple, getDocumentStyles, once, from, removeTagsFromHTML, createImageSync, createImage, waitForImage, };
|