@almadar/ui 5.94.1 → 5.96.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 +1872 -1379
- package/dist/avl/index.js +873 -380
- package/dist/components/core/atoms/AtlasImage.d.ts +58 -0
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/core/molecules/index.d.ts +1 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +10 -6
- package/dist/components/game/2d/templates/GameShell.d.ts +19 -23
- package/dist/components/game/3d/index.cjs +543 -212
- package/dist/components/game/3d/index.js +371 -36
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +7 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- package/dist/components/index.cjs +2153 -1655
- package/dist/components/index.js +1160 -665
- package/dist/components/learning/molecules/AlgorithmCanvas.d.ts +58 -0
- package/dist/lib/atlasSlice.d.ts +58 -0
- package/dist/marketing/index.cjs +208 -73
- package/dist/marketing/index.js +166 -28
- package/dist/providers/index.cjs +1740 -1247
- package/dist/providers/index.js +849 -356
- package/dist/runtime/index.cjs +1733 -1240
- package/dist/runtime/index.js +853 -360
- package/package.json +2 -2
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
|
@@ -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";
|
|
@@ -56,6 +56,7 @@ export { MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type
|
|
|
56
56
|
export { PhysicsCanvas, type PhysicsCanvasProps, type LearningPhysicsBody, type LearningPhysicsConstraint, } from '../../learning/molecules/PhysicsCanvas';
|
|
57
57
|
export { BiologyCanvas, type BiologyCanvasProps, type BiologyNode, type BiologyEdge, } from '../../learning/molecules/BiologyCanvas';
|
|
58
58
|
export { ChemistryCanvas, type ChemistryCanvasProps, type ChemistryAtom, type ChemistryBond, type ChemistryArrow, } from '../../learning/molecules/ChemistryCanvas';
|
|
59
|
+
export { AlgorithmCanvas, type AlgorithmCanvasProps, type AlgorithmBar, type AlgorithmCell, type AlgorithmPointer, } from '../../learning/molecules/AlgorithmCanvas';
|
|
59
60
|
export { GraphView, type GraphViewProps, type GraphViewNode, type GraphViewEdge } from './GraphView';
|
|
60
61
|
export { MapView, type MapViewProps, type MapMarkerData, type MapRouteData, type MapRouteWaypoint } from './MapView';
|
|
61
62
|
export { NumberStepper, type NumberStepperProps, type NumberStepperSize } from './NumberStepper';
|
|
@@ -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 */
|
|
@@ -134,12 +138,12 @@ export interface Canvas2DProps {
|
|
|
134
138
|
spriteMaxWidthRatio?: number;
|
|
135
139
|
/** Override for the diamond-top Y offset within the tile sprite. */
|
|
136
140
|
diamondTopY?: number;
|
|
137
|
-
/** Resolve terrain sprite
|
|
138
|
-
getTerrainSprite?: (terrain: string) => string | undefined;
|
|
139
|
-
/** Resolve feature sprite
|
|
140
|
-
getFeatureSprite?: (featureType: string) => string | undefined;
|
|
141
|
-
/** Resolve unit static sprite URL */
|
|
142
|
-
getUnitSprite?: (unit: IsometricUnit) => string | undefined;
|
|
141
|
+
/** Resolve terrain sprite from terrain key — a bare URL or an Asset (atlas sub-texture ref). */
|
|
142
|
+
getTerrainSprite?: (terrain: string) => string | Asset | undefined;
|
|
143
|
+
/** Resolve feature sprite from feature type key — a bare URL or an Asset. */
|
|
144
|
+
getFeatureSprite?: (featureType: string) => string | Asset | undefined;
|
|
145
|
+
/** Resolve unit static sprite — a bare URL or an Asset. */
|
|
146
|
+
getUnitSprite?: (unit: IsometricUnit) => string | Asset | undefined;
|
|
143
147
|
/** Resolve animated sprite sheet frame for a unit */
|
|
144
148
|
resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
|
|
145
149
|
/** Additional sprite URLs to preload (e.g., effect sprites) */
|
|
@@ -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>;
|