@almadar/ui 5.95.0 → 5.97.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/avl/index.cjs +1665 -1416
- package/dist/avl/index.js +660 -411
- package/dist/components/core/atoms/AtlasImage.d.ts +58 -0
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +4 -0
- package/dist/components/game/2d/templates/GameShell.d.ts +19 -23
- package/dist/components/game/3d/index.cjs +893 -439
- package/dist/components/game/3d/index.js +726 -268
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +9 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- package/dist/components/game/shared/isometricTypes.d.ts +2 -0
- package/dist/components/index.cjs +1645 -1392
- package/dist/components/index.js +637 -387
- package/dist/marketing/index.cjs +208 -73
- package/dist/marketing/index.js +166 -28
- package/dist/providers/index.cjs +1533 -1284
- package/dist/providers/index.js +636 -387
- package/dist/runtime/index.cjs +1526 -1277
- package/dist/runtime/index.js +640 -391
- package/package.json +1 -1
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
- /package/dist/{components/game/shared → lib}/atlasSlice.d.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type SpriteRef } from '../../../lib/atlasSlice';
|
|
3
|
+
/** Asset-compatible input: sheet url + optional atlas sub-texture reference. */
|
|
4
|
+
export interface AtlasImageAsset extends SpriteRef {
|
|
5
|
+
name?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AtlasImageProps {
|
|
9
|
+
asset?: AtlasImageAsset;
|
|
10
|
+
/** Square pixel size (icon usage). Ignored when `fill`. */
|
|
11
|
+
size?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
/** Absolutely fill the nearest positioned ancestor (background usage). */
|
|
15
|
+
fill?: boolean;
|
|
16
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
17
|
+
alt?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
'aria-hidden'?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolve an atlas slice to a standalone dataURL (extracted once, cached) so CSS can 9-slice or
|
|
24
|
+
* tile it — `border-image`/`background-repeat` can't crop a packed sheet. Returns undefined until
|
|
25
|
+
* the sheet + atlas are loaded; `onReady` re-fires the caller when they land.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useAtlasSliceDataUrl(asset: AtlasImageAsset | undefined): string | undefined;
|
|
28
|
+
export interface AtlasPanelProps {
|
|
29
|
+
asset?: AtlasImageAsset;
|
|
30
|
+
/** Border thickness (source pixels) for the 9-slice cut. */
|
|
31
|
+
borderSlice?: number;
|
|
32
|
+
/** Rendered border width in CSS px. */
|
|
33
|
+
borderWidth?: number;
|
|
34
|
+
/** 'nineSlice' scales edges crisp (panels/buttons); 'repeat' tiles the slice (pattern fills). */
|
|
35
|
+
mode?: 'nineSlice' | 'repeat';
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
'aria-hidden'?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A container skinned by an atlas slice: 9-sliced panel chrome or a tiled pattern. The pack sheet
|
|
43
|
+
* is cropped once to a dataURL; CSS border-image / background-repeat does the scaling. Falls back
|
|
44
|
+
* to a plain container while the sheet/atlas load.
|
|
45
|
+
*/
|
|
46
|
+
export declare function AtlasPanel({ asset, borderSlice, borderWidth, mode, className, style, children, 'aria-hidden': ariaHidden }: AtlasPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare namespace AtlasPanel {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The one chrome-side renderer for `Asset` images. With `atlas`+`sprite` it draws EXACTLY that
|
|
52
|
+
* sub-rect of the packed sheet into a canvas (never the whole sheet); otherwise it renders the
|
|
53
|
+
* plain `<img>` path. `fill` + `fit` cover background/panel usage (GameShell, card frames).
|
|
54
|
+
*/
|
|
55
|
+
export declare function AtlasImage({ asset, size, width, height, fill, fit, alt, className, style, 'aria-hidden': ariaHidden, }: AtlasImageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
56
|
+
export declare namespace AtlasImage {
|
|
57
|
+
var displayName: string;
|
|
58
|
+
}
|
|
@@ -7,6 +7,7 @@ export { Select, type SelectProps, type SelectOption, type SelectOptionGroup } f
|
|
|
7
7
|
export { Checkbox, type CheckboxProps } from "./Checkbox";
|
|
8
8
|
export { Card, CardHeader, CardTitle, CardContent, CardBody, CardFooter, type CardProps, } from "./Card";
|
|
9
9
|
export { Badge, type BadgeProps, type BadgeVariant } from "./Badge";
|
|
10
|
+
export { AtlasImage, AtlasPanel, useAtlasSliceDataUrl, type AtlasImageProps, type AtlasImageAsset, type AtlasPanelProps } from "./AtlasImage";
|
|
10
11
|
export { FilterPill, type FilterPillProps, type FilterPillVariant, type FilterPillSize, } from "./FilterPill";
|
|
11
12
|
export { Spinner, type SpinnerProps } from "./Spinner";
|
|
12
13
|
export { Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, } from "./Avatar";
|
|
@@ -53,6 +53,10 @@ export interface SidePlayer {
|
|
|
53
53
|
vy?: number;
|
|
54
54
|
grounded?: boolean;
|
|
55
55
|
facingRight?: boolean;
|
|
56
|
+
/** Animation state name — driven by the LOLO state machine (e.g. "idle", "walk", "jump"). */
|
|
57
|
+
animation?: string;
|
|
58
|
+
/** Frame index within the animation — driven by the LOLO state machine. */
|
|
59
|
+
frame?: number;
|
|
56
60
|
}
|
|
57
61
|
export interface Canvas2DProps {
|
|
58
62
|
/** Additional CSS classes */
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GameShell
|
|
2
|
+
* GameShell — thin fullscreen game SURFACE.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Wrap game page content directly as children:
|
|
9
|
-
* <GameShell appName="TraitWars">
|
|
10
|
-
* <WorldMapPage />
|
|
11
|
-
* </GameShell>
|
|
12
|
-
*
|
|
13
|
-
* @generated pattern — can be customised per-game via props
|
|
4
|
+
* Contributes positioning + the game skin (Kenney font, 9-slice panel chrome, floating overlays)
|
|
5
|
+
* and nothing else: the canvas fills the viewport underneath; composed atoms/molecules land in
|
|
6
|
+
* overlay slots. `hud` floats top; `addons` floats bottom-right (action cluster). Dumb: props in,
|
|
7
|
+
* layout out — no descriptor resolution, no runtime logic.
|
|
14
8
|
*/
|
|
15
9
|
import React from "react";
|
|
16
10
|
import type { Asset } from "@almadar/core";
|
|
17
11
|
export interface GameShellProps {
|
|
18
|
-
/** Application / game title shown
|
|
12
|
+
/** Application / game title shown as a floating chip */
|
|
19
13
|
appName?: string;
|
|
20
|
-
/**
|
|
14
|
+
/** Stat chips row — floats along the top edge */
|
|
21
15
|
hud?: React.ReactNode;
|
|
16
|
+
/** Action cluster — floats bottom-right (End Turn, Fire, Reset, …) */
|
|
17
|
+
addons?: React.ReactNode;
|
|
18
|
+
/** Movement controls — floats bottom-left (d-pad / control-grid). */
|
|
19
|
+
controls?: React.ReactNode;
|
|
20
|
+
/** Centered overlay layer (victory/defeat banners, dialogs). */
|
|
21
|
+
overlay?: React.ReactNode;
|
|
22
22
|
/** Extra class name on the root container */
|
|
23
23
|
className?: string;
|
|
24
|
-
/** Whether to show the
|
|
24
|
+
/** Whether to show the title chip (default: true) */
|
|
25
25
|
showTopBar?: boolean;
|
|
26
|
-
/** Game content
|
|
26
|
+
/** Game content — fills the whole surface underneath the overlays */
|
|
27
27
|
children?: React.ReactNode;
|
|
28
|
-
/**
|
|
28
|
+
/** Pattern slice tiled at low opacity across the surface (never cover-stretched). */
|
|
29
29
|
backgroundAsset?: Asset;
|
|
30
|
-
/**
|
|
30
|
+
/** 9-sliced panel skin for the HUD chips row + title chip. */
|
|
31
31
|
hudBackgroundAsset?: Asset;
|
|
32
|
+
/** Game font key (future | future-narrow | pixel | blocks | mini) or a CSS font-family. */
|
|
33
|
+
fontFamily?: string;
|
|
32
34
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Full-viewport game shell layout.
|
|
35
|
-
*
|
|
36
|
-
* Renders children inside a full-height flex container.
|
|
37
|
-
* An optional top bar shows the game title and can host HUD widgets.
|
|
38
|
-
*/
|
|
39
35
|
export declare const GameShell: React.FC<GameShellProps>;
|