@almadar/ui 5.105.0 → 5.108.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 +2127 -5818
- package/dist/avl/index.js +1234 -4925
- package/dist/components/{game/2d → core}/atoms/GameIcon.d.ts +1 -1
- package/dist/components/core/atoms/index.d.ts +2 -1
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +1 -1
- package/dist/components/core/templates/index.d.ts +1 -2
- package/dist/components/game/{2d/atoms → atoms}/ChoiceButton.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ControlButton.d.ts +1 -1
- package/dist/components/game/atoms/DrawShape.d.ts +50 -0
- package/dist/components/game/atoms/DrawSprite.d.ts +47 -0
- package/dist/components/game/atoms/DrawText.d.ts +31 -0
- package/dist/components/game/{2d/atoms → atoms}/GameAudioToggle.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/MiniMap.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ScoreDisplay.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/StateIndicator.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/ActionTile.d.ts +1 -1
- package/dist/components/game/molecules/Canvas.d.ts +96 -0
- package/dist/components/game/molecules/Canvas2D.d.ts +120 -0
- package/dist/components/game/{2d/molecules → molecules}/ControlGrid.d.ts +1 -1
- package/dist/components/game/molecules/DrawShapeLayer.d.ts +19 -0
- package/dist/components/game/molecules/DrawSpriteLayer.d.ts +21 -0
- package/dist/components/game/molecules/DrawTextLayer.d.ts +22 -0
- package/dist/components/game/{2d/molecules → molecules}/GameHud.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StatBadge.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StateNode.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitSlot.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitStateViewer.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TransitionArrow.d.ts +1 -1
- package/dist/components/game/molecules/index.d.ts +39 -0
- package/dist/components/game/patterns.d.ts +20 -0
- package/dist/components/index.cjs +2417 -5988
- package/dist/components/index.js +1520 -5074
- package/dist/{components/game/shared/hooks → hooks}/useCamera.d.ts +1 -1
- package/dist/{components/game/shared/hooks → hooks}/useUnitSpriteAtlas.d.ts +2 -2
- package/dist/lib/drawable/contract.d.ts +68 -0
- package/dist/lib/drawable/hitTest.d.ts +23 -0
- package/dist/lib/drawable/paintDispatch.d.ts +22 -0
- package/dist/lib/drawable/projector.d.ts +14 -0
- package/dist/lib/drawable/projector3d.d.ts +20 -0
- package/dist/lib/drawable/three/Canvas3DHost.d.ts +178 -0
- package/dist/lib/drawable/three/Drawable3D.d.ts +20 -0
- package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
- package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
- package/dist/{components/game/shared → lib/drawable/three}/hooks/useGameCanvas3DEvents.d.ts +4 -3
- package/dist/{components/game/3d → lib/drawable/three}/index.cjs +2223 -4466
- package/dist/{components/game/3d → lib/drawable/three}/index.css +3 -3
- package/dist/lib/drawable/three/index.d.ts +39 -0
- package/dist/{components/game/3d → lib/drawable/three}/index.js +2132 -4375
- package/dist/lib/drawable/three/mesh3d.d.ts +28 -0
- package/dist/{components/game/shared/index.d.ts → lib/gameShared.d.ts} +1 -2
- package/dist/lib/imageCache.d.ts +9 -0
- package/dist/lib/painter2d.d.ts +81 -0
- package/dist/{components/game/shared/lib → lib}/puzzleObject.d.ts +11 -2
- package/dist/lib/webPainter2d.d.ts +7 -0
- package/dist/marketing/index.cjs +10 -0
- package/dist/marketing/index.js +10 -0
- package/dist/{components/game/shared/providers → providers}/GameAudioProvider.d.ts +1 -1
- package/dist/providers/index.cjs +2524 -5889
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +1743 -5112
- package/dist/runtime/index.cjs +1982 -5673
- package/dist/runtime/index.js +1208 -4899
- package/package.json +13 -13
- package/dist/components/game/2d/atoms/ActionButton.d.ts +0 -31
- package/dist/components/game/2d/atoms/ComboCounter.d.ts +0 -20
- package/dist/components/game/2d/atoms/DamageNumber.d.ts +0 -18
- package/dist/components/game/2d/atoms/GameCard.d.ts +0 -34
- package/dist/components/game/2d/atoms/ItemSlot.d.ts +0 -31
- package/dist/components/game/2d/atoms/ResourceCounter.d.ts +0 -26
- package/dist/components/game/2d/atoms/Sprite.d.ts +0 -52
- package/dist/components/game/2d/atoms/StatusEffect.d.ts +0 -25
- package/dist/components/game/2d/atoms/TurnIndicator.d.ts +0 -22
- package/dist/components/game/2d/atoms/WaypointMarker.d.ts +0 -23
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +0 -175
- package/dist/components/game/2d/molecules/EventLog.d.ts +0 -31
- package/dist/components/game/2d/molecules/InventoryGrid.d.ts +0 -35
- package/dist/components/game/2d/molecules/ObjectRulePanel.d.ts +0 -32
- package/dist/components/game/2d/molecules/ResourceBar.d.ts +0 -26
- package/dist/components/game/2d/molecules/RuleEditor.d.ts +0 -39
- package/dist/components/game/2d/molecules/SideCanvas2D.d.ts +0 -36
- package/dist/components/game/2d/molecules/VariablePanel.d.ts +0 -28
- package/dist/components/game/2d/molecules/index.d.ts +0 -66
- package/dist/components/game/2d/organisms/BuilderBoard.d.ts +0 -60
- package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +0 -66
- package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +0 -61
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +0 -42
- package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +0 -56
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +0 -69
- package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +0 -58
- package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +0 -61
- package/dist/components/game/2d/templates/GameTemplate.d.ts +0 -35
- package/dist/components/game/3d/atoms/EventMarker3D.d.ts +0 -17
- package/dist/components/game/3d/atoms/SpriteBillboard3D.d.ts +0 -18
- package/dist/components/game/3d/index.d.ts +0 -13
- package/dist/components/game/3d/molecules/FeatureMesh3D.d.ts +0 -21
- package/dist/components/game/3d/molecules/GameCamera3D.d.ts +0 -35
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +0 -259
- package/dist/components/game/3d/molecules/SideScene3D.d.ts +0 -31
- package/dist/components/game/3d/molecules/TileMesh3D.d.ts +0 -28
- package/dist/components/game/3d/molecules/UnitMesh3D.d.ts +0 -29
- package/dist/components/game/3d/molecules/index.d.ts +0 -35
- package/dist/components/game/3d/organisms/GameBoard3D.d.ts +0 -66
- package/dist/components/game/3d/patterns.d.ts +0 -20
- package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +0 -82
- package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +0 -87
- package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +0 -95
- package/dist/components/game/shared/effects.d.ts +0 -253
- package/dist/components/game/shared/game3dTheme.d.ts +0 -55
- package/dist/components/game/shared/lib/game3dAssetManifest.d.ts +0 -48
- /package/dist/components/game/{2d/atoms → atoms}/DialogueBubble.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/HealthBar.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/TimerDisplay.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/GameMenu.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/SequenceBar.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateGraph.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateJsonView.d.ts +0 -0
- /package/dist/components/game/{2d/templates → templates}/GameShell.d.ts +0 -0
- /package/dist/{components/game/shared/hooks → hooks}/useGameAudio.d.ts +0 -0
- /package/dist/{components/game/shared → hooks}/useImageCache.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/boardEntity.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useRaycaster.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useThree.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/AssetLoader.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/culling.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/grid3D.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/editorUtils.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/game.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/isometric.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/isometricTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/makeAsset.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/mechanics.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/physicsPresets.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/physicsTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteAnimation.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteAnimationTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteSheetConstants.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Asset } from '@almadar/core';
|
|
3
|
-
import { type IconInput } from '
|
|
3
|
+
import { type IconInput } from './Icon';
|
|
4
4
|
export interface GameIconProps {
|
|
5
5
|
/** Asset — when url is present, renders an img (Asset-primary). */
|
|
6
6
|
assetUrl?: Asset;
|
|
@@ -8,6 +8,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
10
|
export { AtlasImage, AtlasPanel, useAtlasSliceDataUrl, type AtlasImageProps, type AtlasImageAsset, type AtlasPanelProps } from "./AtlasImage";
|
|
11
|
+
export { GameIcon, type GameIconProps } from "./GameIcon";
|
|
11
12
|
export { FilterPill, type FilterPillProps, type FilterPillVariant, type FilterPillSize, } from "./FilterPill";
|
|
12
13
|
export { Spinner, type SpinnerProps } from "./Spinner";
|
|
13
14
|
export { Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, } from "./Avatar";
|
|
@@ -46,6 +47,6 @@ export { PatternTile, getTileDimensions, type PatternTileProps, type PatternVari
|
|
|
46
47
|
export { AnimatedReveal, type AnimatedRevealProps, type RevealTrigger, type RevealAnimation } from "../../marketing/atoms/AnimatedReveal";
|
|
47
48
|
export { AnimatedGraphic, type AnimatedGraphicProps, type GraphicAnimation } from "../../marketing/atoms/AnimatedGraphic";
|
|
48
49
|
export { TraitFrame, type TraitFrameProps } from "./TraitFrame";
|
|
49
|
-
export * from "../../game/
|
|
50
|
+
export * from "../../game/molecules/index";
|
|
50
51
|
export { LearningCanvas, type LearningCanvasProps, type LearningShape, type LearningPoint, type LearningShapeType, } from "../../learning/atoms/LearningCanvas";
|
|
51
52
|
export { type UiError, type LinkAction, type ImageSource, type Point, type Rect, } from "./types";
|
|
@@ -51,7 +51,7 @@ export { DateRangeSelector, type DateRangeSelectorProps, type DateRangeSelectorO
|
|
|
51
51
|
export { ChartLegend, type ChartLegendProps, type ChartLegendItem } from './ChartLegend';
|
|
52
52
|
export { LineChart, type LineChartProps, type ChartDataPoint } from './LineChart';
|
|
53
53
|
export { ProgressDots, type ProgressDotsProps, type DotState, type DotSize } from './ProgressDots';
|
|
54
|
-
export * from '../../game/
|
|
54
|
+
export * from '../../game/molecules/index';
|
|
55
55
|
export { MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type MathVector, } from '../../learning/molecules/MathCanvas';
|
|
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';
|
|
@@ -9,7 +9,7 @@ export { MasterDetail, type MasterDetailProps } from "./MasterDetail";
|
|
|
9
9
|
export { StateMachineView, DomStateMachineVisualizer, OrbitalStateMachineView, type StateMachineViewProps, type TransitionBundle, } from "./StateMachineView";
|
|
10
10
|
export * from "./book/index";
|
|
11
11
|
export * from "./layout/index";
|
|
12
|
-
export * from "../../game/
|
|
12
|
+
export * from "../../game/molecules/index";
|
|
13
13
|
export { UISlotRenderer, UISlotComponent, SlotContentRenderer, type UISlotRendererProps, } from "./UISlotRenderer";
|
|
14
14
|
export { ModalSlot, type ModalSlotProps } from "./ModalSlot";
|
|
15
15
|
export { DrawerSlot, type DrawerSlotProps } from "./DrawerSlot";
|
|
@@ -2,9 +2,8 @@ export type { TemplateProps } from './types';
|
|
|
2
2
|
export { DashboardLayout, type DashboardLayoutProps, type NavItem } from './DashboardLayout';
|
|
3
3
|
export { AuthLayout, type AuthLayoutProps } from '../../marketing/templates/AuthLayout';
|
|
4
4
|
export { CounterTemplate, type CounterTemplateProps, type CounterSize, type CounterVariant } from './CounterTemplate';
|
|
5
|
-
export { GameTemplate, type GameTemplateProps } from '../../game/2d/templates/GameTemplate';
|
|
6
5
|
export { GenericAppTemplate, type GenericAppTemplateProps } from './GenericAppTemplate';
|
|
7
|
-
export { GameShell, type GameShellProps } from '../../game/
|
|
6
|
+
export { GameShell, type GameShellProps } from '../../game/templates/GameShell';
|
|
8
7
|
export { LandingPageTemplate, type LandingPageTemplateProps, type LandingPageEntity, } from '../../marketing/templates/LandingPageTemplate';
|
|
9
8
|
export { PricingPageTemplate, type PricingPageTemplateProps, type PricingPageEntity, } from '../../marketing/templates/PricingPageTemplate';
|
|
10
9
|
export { FeatureDetailPageTemplate, type FeatureDetailPageTemplateProps, type FeatureDetailPageEntity, type FeatureDetailSection, } from '../../marketing/templates/FeatureDetailPageTemplate';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type IconInput } from '
|
|
2
|
+
import { type IconInput } from '../../core/atoms/Icon';
|
|
3
3
|
import type { Asset, EventKey } from '@almadar/core';
|
|
4
4
|
export interface ChoiceButtonProps {
|
|
5
5
|
/** Choice text content */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { EventKey, Asset } from "@almadar/core";
|
|
3
|
-
import { type IconInput } from '
|
|
3
|
+
import { type IconInput } from '../../core/atoms/Icon';
|
|
4
4
|
export interface ControlButtonProps {
|
|
5
5
|
/** Sprite asset — takes precedence over icon when provided */
|
|
6
6
|
assetUrl?: Asset;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-shape` — the neutral vector-fill/stroke drawable atom (dimension-agnostic).
|
|
3
|
+
*
|
|
4
|
+
* ONE descriptor (`DrawShapeProps`, grounded in core `ScenePos`) with TWO
|
|
5
|
+
* backends: `paintShape` (2D, here) and an R3F ground-plane mesh (`Shape3D` in
|
|
6
|
+
* `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
|
|
7
|
+
* Paints a cell footprint, an axis-aligned rect, an ellipse, or a poly at a scene
|
|
8
|
+
* position, fill and/or stroke. Genre uses (tile fallback, iso/hex diamond
|
|
9
|
+
* fallback, cell highlight, feature disc, unit selection ring, unit fallback
|
|
10
|
+
* circle, ground/ghost discs, solid backgrounds, side-view platform rects) are
|
|
11
|
+
* all this atom with different `shape`/`anchor`/geometry — composed in `.lolo`,
|
|
12
|
+
* not here. The React component renders `null`; it exists so the pattern pipeline
|
|
13
|
+
* registers a `draw-shape` pattern and standalone pages stay inspectable.
|
|
14
|
+
*/
|
|
15
|
+
import type React from 'react';
|
|
16
|
+
import type { ScenePos } from '@almadar/core';
|
|
17
|
+
import type { PainterPoint } from '../../../lib/painter2d';
|
|
18
|
+
import type { DrawableAnchor, DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
19
|
+
export type ShapeKind = 'cell' | 'rect' | 'ellipse' | 'poly';
|
|
20
|
+
export interface DrawShapeProps extends DrawableBase {
|
|
21
|
+
type: 'draw-shape';
|
|
22
|
+
shape: ShapeKind;
|
|
23
|
+
/** Logical scene position; the projector maps it to pixels / world. */
|
|
24
|
+
position: ScenePos;
|
|
25
|
+
/** How the shape aligns to its projected position. Default varies by `shape`. */
|
|
26
|
+
anchor?: DrawableAnchor;
|
|
27
|
+
/** Rect width in px. */
|
|
28
|
+
width?: number;
|
|
29
|
+
/** Rect height in px. */
|
|
30
|
+
height?: number;
|
|
31
|
+
/** Ellipse horizontal radius in px. */
|
|
32
|
+
radiusX?: number;
|
|
33
|
+
/** Ellipse vertical radius in px; omitted → `radiusX` (a circle). */
|
|
34
|
+
radiusY?: number;
|
|
35
|
+
/** Fine px nudge from the anchor point (e.g. a disc drawn at `groundY - 8*scale`). */
|
|
36
|
+
offsetX?: number;
|
|
37
|
+
offsetY?: number;
|
|
38
|
+
/** Poly vertices as px offsets relative to the cell's projected top-left. */
|
|
39
|
+
points?: PainterPoint[];
|
|
40
|
+
fill?: string;
|
|
41
|
+
stroke?: string;
|
|
42
|
+
strokeWidth?: number;
|
|
43
|
+
/** 0..1 opacity. */
|
|
44
|
+
opacity?: number;
|
|
45
|
+
}
|
|
46
|
+
/** Paint a {@link DrawShapeProps}. Skips a draw when its required geometry is missing — never throws. */
|
|
47
|
+
export declare const paintShape: PaintFn<DrawShapeProps>;
|
|
48
|
+
/** Registry/standalone stub — the host paints this atom; the DOM renders nothing. */
|
|
49
|
+
export declare function DrawShape(_props: DrawShapeProps): React.JSX.Element | null;
|
|
50
|
+
export default DrawShape;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-sprite` — the neutral image/atlas-frame drawable atom (dimension-agnostic).
|
|
3
|
+
*
|
|
4
|
+
* ONE descriptor (`DrawSpriteProps`, grounded in core `ScenePos` + `Asset`) with
|
|
5
|
+
* TWO backends: `paintSprite` (2D, here — via the portable `Painter2D` seam) and
|
|
6
|
+
* an R3F mesh (`Sprite3D` in `lib/drawable/mesh3d`, kept OUT of this file so the
|
|
7
|
+
* 2D paint path never pulls `three`/`drei` into an app bundle — the codebase
|
|
8
|
+
* code-splits R3F). The canvas host picks the backend by `mode`; that is what
|
|
9
|
+
* makes canvas-2d and canvas-3d the same `children` interface. Genre uses (tile,
|
|
10
|
+
* unit body, feature, effect, movement ghost, background cover) are all this atom
|
|
11
|
+
* with different `anchor`/`size`/`frame`/`flip`/`shadow` — composed in `.lolo`,
|
|
12
|
+
* not here. The React component renders `null` (a drawable is painted by the host,
|
|
13
|
+
* not the DOM); it exists so the pattern pipeline registers a `draw-sprite`
|
|
14
|
+
* pattern and standalone pages stay inspectable.
|
|
15
|
+
*/
|
|
16
|
+
import type React from 'react';
|
|
17
|
+
import type { Asset, ScenePos } from '@almadar/core';
|
|
18
|
+
import type { BlitSrc, PainterShadow } from '../../../lib/painter2d';
|
|
19
|
+
import type { DrawableAnchor, DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
20
|
+
export interface DrawSpriteProps extends DrawableBase {
|
|
21
|
+
type: 'draw-sprite';
|
|
22
|
+
/** Logical scene position; the projector maps it to pixels / world. */
|
|
23
|
+
position: ScenePos;
|
|
24
|
+
/** The image / atlas reference to blit. */
|
|
25
|
+
asset: Asset;
|
|
26
|
+
/** How the sprite aligns to its projected position. Default `'top-left'`. */
|
|
27
|
+
anchor?: DrawableAnchor;
|
|
28
|
+
/** Draw width in px (2D) / world units (3D); omitted → resolved source width. */
|
|
29
|
+
width?: number;
|
|
30
|
+
/** Draw height in px (2D) / world units (3D); omitted → resolved source height. */
|
|
31
|
+
height?: number;
|
|
32
|
+
/** Explicit atlas sub-rect override (px); omitted → resolved from `asset.atlas`/`asset.sprite`. */
|
|
33
|
+
frame?: BlitSrc;
|
|
34
|
+
/** Mirror horizontally (facing). */
|
|
35
|
+
flipX?: boolean;
|
|
36
|
+
/** Rotation in radians about the sprite's center. */
|
|
37
|
+
rotation?: number;
|
|
38
|
+
/** 0..1 opacity. */
|
|
39
|
+
opacity?: number;
|
|
40
|
+
/** Drop shadow (e.g. a team-colored glow). */
|
|
41
|
+
shadow?: PainterShadow;
|
|
42
|
+
}
|
|
43
|
+
/** Paint a {@link DrawSpriteProps}. Renders nothing (returns) when a resource is not ready — never throws. */
|
|
44
|
+
export declare const paintSprite: PaintFn<DrawSpriteProps>;
|
|
45
|
+
/** Registry/standalone stub — the host paints this atom; the DOM renders nothing. */
|
|
46
|
+
export declare function DrawSprite(_props: DrawSpriteProps): React.JSX.Element | null;
|
|
47
|
+
export default DrawSprite;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-text` — the neutral text drawable atom (dimension-agnostic).
|
|
3
|
+
*
|
|
4
|
+
* ONE descriptor (`DrawTextProps`, grounded in core `ScenePos`) with TWO backends:
|
|
5
|
+
* `paintText` (2D, here) and an R3F billboarded `<Text>` (`Text3D` in
|
|
6
|
+
* `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
|
|
7
|
+
* Paints a string at a scene position with font/color/alignment. The React
|
|
8
|
+
* component renders `null` (a drawable is painted by the host, not the DOM).
|
|
9
|
+
*/
|
|
10
|
+
import type React from 'react';
|
|
11
|
+
import type { ScenePos } from '@almadar/core';
|
|
12
|
+
import type { DrawableAnchor, DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
13
|
+
export interface DrawTextProps extends DrawableBase {
|
|
14
|
+
type: 'draw-text';
|
|
15
|
+
text: string;
|
|
16
|
+
/** Logical scene position; the projector maps it to pixels / world. */
|
|
17
|
+
position: ScenePos;
|
|
18
|
+
anchor?: DrawableAnchor;
|
|
19
|
+
offsetX?: number;
|
|
20
|
+
offsetY?: number;
|
|
21
|
+
color: string;
|
|
22
|
+
font?: string;
|
|
23
|
+
align?: CanvasTextAlign;
|
|
24
|
+
baseline?: CanvasTextBaseline;
|
|
25
|
+
opacity?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Paint a {@link DrawTextProps}. */
|
|
28
|
+
export declare const paintText: PaintFn<DrawTextProps>;
|
|
29
|
+
/** Registry/standalone stub — the host paints this atom; the DOM renders nothing. */
|
|
30
|
+
export declare function DrawText(_props: DrawTextProps): React.JSX.Element | null;
|
|
31
|
+
export default DrawText;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import type { Asset } from '@almadar/core';
|
|
15
|
-
import type { UiError } from '
|
|
15
|
+
import type { UiError } from '../../core/atoms/types';
|
|
16
16
|
export interface GameAudioToggleProps {
|
|
17
17
|
/** Button size */
|
|
18
18
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type IconInput } from '
|
|
2
|
+
import { type IconInput } from '../../core/atoms/Icon';
|
|
3
3
|
import type { Asset } from '@almadar/core';
|
|
4
4
|
export interface ScoreDisplayProps {
|
|
5
5
|
/** Sprite asset — takes precedence over icon when provided */
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import type { DisplayStateProps } from '
|
|
11
|
+
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
12
12
|
import type { SlotItemData } from './TraitSlot';
|
|
13
13
|
export interface ActionTileProps extends DisplayStateProps {
|
|
14
14
|
/** The action data */
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas — the unified game canvas draw-host (P6 closing).
|
|
3
|
+
*
|
|
4
|
+
* A single `type: canvas` host that renders authored `drawables` (the neutral
|
|
5
|
+
* `draw-*` children) through the 2D painter or the 3D painter selected by `mode`.
|
|
6
|
+
* Both painters consume the EXACT same `drawables`; they differ only in how a
|
|
7
|
+
* `ScenePos` projects and how a sprite/shape/text is rasterized vs meshed. This
|
|
8
|
+
* retires the direct use of `canvas-2d` / `game-canvas-3d` from board authoring:
|
|
9
|
+
* a board writes `{ type: canvas, mode, camera, children: [...] }`.
|
|
10
|
+
*
|
|
11
|
+
* Camera: the neutral core `Camera` ({ mode, zoom, ... }) is mapped to each
|
|
12
|
+
* host's legacy vocab here (2D `camera` string / 3D `cameraMode`; `zoom` → `scale`),
|
|
13
|
+
* so the board carries one camera object regardless of painter.
|
|
14
|
+
*
|
|
15
|
+
* Interaction: a click/hover event is one event-name string forwarded to whichever
|
|
16
|
+
* painter `mode` selects. Its payload phantom is the merge of both painters' emit
|
|
17
|
+
* shapes so the single value stays assignable to either host's prop (the two hosts
|
|
18
|
+
* still emit their own coordinate shape at runtime).
|
|
19
|
+
*
|
|
20
|
+
* The 3D host (three.js/R3F) is lazy-imported so a 2D-only app never pulls the
|
|
21
|
+
* 3D bundle — the code-split boundary the drawable atoms were built R3F-free for.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
import * as React from 'react';
|
|
26
|
+
import type { Asset, AssetUrl, Camera, EventEmit } from '@almadar/core';
|
|
27
|
+
import type { DrawableNode } from '../../../lib/drawable/paintDispatch';
|
|
28
|
+
import { type Projection } from './Canvas2D';
|
|
29
|
+
/** Painter selection. Same `drawables` for both; differ only in projection + rasterizer. */
|
|
30
|
+
export type CanvasMode = '2d' | '3d';
|
|
31
|
+
export interface CanvasProps {
|
|
32
|
+
/** Painter: 2D sprite/shape/text raster, or 3D mesh. Default '2d'. */
|
|
33
|
+
mode?: CanvasMode;
|
|
34
|
+
/** Neutral drawable descriptors — the `draw-*` children. Routed to the host's painter. */
|
|
35
|
+
drawables?: DrawableNode[];
|
|
36
|
+
/** Neutral camera pose. Mapped to the underlying host's framing + zoom. */
|
|
37
|
+
camera?: Camera;
|
|
38
|
+
/** 2D grid layout (2D mode only): isometric / hex / flat / free / side. */
|
|
39
|
+
projection?: Projection;
|
|
40
|
+
className?: string;
|
|
41
|
+
isLoading?: boolean;
|
|
42
|
+
/** Unit draw-size multiplier (both painters). */
|
|
43
|
+
unitScale?: number;
|
|
44
|
+
/** Minimap overlay (2D). */
|
|
45
|
+
showMinimap?: boolean;
|
|
46
|
+
/** Backdrop image (2D iso/hex/flat/free/side). */
|
|
47
|
+
backgroundImage?: AssetUrl | Asset;
|
|
48
|
+
/** Solid backdrop colour — 2D `side` fill and 3D scene clear colour. */
|
|
49
|
+
backgroundColor?: string;
|
|
50
|
+
/** Side/free world bounds (2D `side`) and 3D world extent. */
|
|
51
|
+
worldWidth?: number;
|
|
52
|
+
worldHeight?: number;
|
|
53
|
+
/** 3D world-unit → pixel scale (perspective/side depth). 3D only. */
|
|
54
|
+
pixelsPerUnit?: number;
|
|
55
|
+
/** 3D-only presentation. */
|
|
56
|
+
showGrid?: boolean;
|
|
57
|
+
shadows?: boolean;
|
|
58
|
+
showCoordinates?: boolean;
|
|
59
|
+
showTileInfo?: boolean;
|
|
60
|
+
fogOfWar?: boolean[][];
|
|
61
|
+
tileClickEvent?: EventEmit<{
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
} & {
|
|
65
|
+
tileId: string;
|
|
66
|
+
z: number;
|
|
67
|
+
}>;
|
|
68
|
+
unitClickEvent?: EventEmit<{
|
|
69
|
+
unitId: string;
|
|
70
|
+
} & {
|
|
71
|
+
x: number;
|
|
72
|
+
z: number;
|
|
73
|
+
}>;
|
|
74
|
+
tileHoverEvent?: EventEmit<{
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
} & {
|
|
78
|
+
tileId: string;
|
|
79
|
+
z: number;
|
|
80
|
+
}>;
|
|
81
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
82
|
+
/** Feature-click event (3D only). */
|
|
83
|
+
featureClickEvent?: EventEmit<{
|
|
84
|
+
featureId: string;
|
|
85
|
+
x: number;
|
|
86
|
+
z: number;
|
|
87
|
+
type?: string;
|
|
88
|
+
elevation?: number;
|
|
89
|
+
}>;
|
|
90
|
+
keyMap?: Record<string, string>;
|
|
91
|
+
keyUpMap?: Record<string, string>;
|
|
92
|
+
}
|
|
93
|
+
export declare function Canvas({ mode, drawables, camera, projection, className, isLoading, unitScale, showMinimap, backgroundImage, backgroundColor, worldWidth, worldHeight, pixelsPerUnit, showGrid, shadows, showCoordinates, showTileInfo, fogOfWar, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, featureClickEvent, keyMap, keyUpMap, }: CanvasProps): React.JSX.Element;
|
|
94
|
+
export declare namespace Canvas {
|
|
95
|
+
var displayName: string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas2D — the thin 2D draw-host (Drawable Canvas, P6 closing).
|
|
3
|
+
*
|
|
4
|
+
* A pure walker: the board authors a `drawables` list (the neutral `draw-*`
|
|
5
|
+
* children) and this host paints them through the portable `Painter2D` seam,
|
|
6
|
+
* projecting each `ScenePos` for the chosen `projection` (iso/hex/flat/free/side).
|
|
7
|
+
* It owns NO game data — tiles, units, features, effects, highlights, health bars
|
|
8
|
+
* and labels are all `draw-*` children composed in `.lolo`, not props here. The
|
|
9
|
+
* only local state is view state: viewport size, camera, sprite/atlas cache.
|
|
10
|
+
*
|
|
11
|
+
* Projections: iso/hex/flat/free go through the shared `create2DProjector`; `side`
|
|
12
|
+
* reuses the `free` (identity, world-pixel) projector — side boards author their
|
|
13
|
+
* platforms/player as `draw-*` children like every other board.
|
|
14
|
+
*
|
|
15
|
+
* Camera: `pan-zoom` (drag+wheel), `fixed` (still), or `follow` (lerps to the
|
|
16
|
+
* neutral core `Camera.target`, forwarded as `followTarget`). The unit-position
|
|
17
|
+
* interpolation of the old data-prop host is gone — the LOLO state machine owns
|
|
18
|
+
* entity motion; this host only tweens the camera.
|
|
19
|
+
*
|
|
20
|
+
* Interaction: a pointer emits the projector-unprojected scene coordinate as
|
|
21
|
+
* `tileClickEvent`/`tileHoverEvent` `{ x, y }` (the FSM validates the cell) and
|
|
22
|
+
* `tileLeaveEvent` `{}`. `unitClickEvent` needs a per-entity id the neutral
|
|
23
|
+
* drawable descriptors don't carry (they hold only a `ScenePos`); its hit-test is
|
|
24
|
+
* a deferred, tracked fork (see docs/Almadar_Std_Game_V2_PLAN.md) — the prop is
|
|
25
|
+
* accepted but not yet emitted from a coordinate.
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
*/
|
|
29
|
+
import * as React from 'react';
|
|
30
|
+
import type { Asset, AssetUrl, EventEmit, ScenePos } from '@almadar/core';
|
|
31
|
+
import { type DrawableNode } from '../../../lib/drawable/paintDispatch';
|
|
32
|
+
import type { UiError } from '../../core/atoms/types';
|
|
33
|
+
export interface TileCoord {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}
|
|
37
|
+
/** Projection axis. iso/hex/flat use `isoToScreen`; `free`/`side` are world-pixel-direct. */
|
|
38
|
+
export type Projection = 'isometric' | 'hex' | 'flat' | 'free' | 'side';
|
|
39
|
+
/** Camera behavior. `pan-zoom` = user drag+wheel; `follow` = track `followTarget`;
|
|
40
|
+
* `fixed` = no camera motion. */
|
|
41
|
+
export type CameraMode = 'pan-zoom' | 'follow' | 'fixed';
|
|
42
|
+
/** A side-view platform (AABB rect). Retained as a shared type for the 3D side
|
|
43
|
+
* scene; side boards now author platforms as `draw-*` children, not this shape. */
|
|
44
|
+
export interface Platform {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
type?: 'ground' | 'platform' | 'hazard' | 'goal';
|
|
50
|
+
}
|
|
51
|
+
/** A side-view player. Retained as a shared type for the 3D side scene; side
|
|
52
|
+
* boards now author the player as a `draw-sprite` child, not this shape. */
|
|
53
|
+
export interface SidePlayer {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
width?: number;
|
|
57
|
+
height?: number;
|
|
58
|
+
vx?: number;
|
|
59
|
+
vy?: number;
|
|
60
|
+
grounded?: boolean;
|
|
61
|
+
facingRight?: boolean;
|
|
62
|
+
animation?: string;
|
|
63
|
+
frame?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface Canvas2DProps {
|
|
66
|
+
/** Additional CSS classes */
|
|
67
|
+
className?: string;
|
|
68
|
+
/** Loading state indicator */
|
|
69
|
+
isLoading?: boolean;
|
|
70
|
+
/** Error state */
|
|
71
|
+
error?: UiError | null;
|
|
72
|
+
/** Projection axis (default 'isometric'). */
|
|
73
|
+
projection?: Projection;
|
|
74
|
+
/** Neutral drawable descriptors (the `draw-*` children). The host walks these. */
|
|
75
|
+
drawables?: DrawableNode[];
|
|
76
|
+
/** Background image (tiled behind iso/hex/flat/free; cover-scaled for atlas slices).
|
|
77
|
+
* A bare URL string is accepted as shorthand for a standalone backdrop. */
|
|
78
|
+
backgroundImage?: AssetUrl | Asset;
|
|
79
|
+
/** Emits UI:{tileClickEvent} with the unprojected scene { x, y } on click. */
|
|
80
|
+
tileClickEvent?: EventEmit<{
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Unit-click event. The neutral drawable host cannot resolve a click to a
|
|
86
|
+
* per-entity id (descriptors carry only a `ScenePos`, no id), so this prop is
|
|
87
|
+
* accepted but not yet emitted — the id-hit-test is a tracked fork
|
|
88
|
+
* (docs/Almadar_Std_Game_V2_PLAN.md).
|
|
89
|
+
*/
|
|
90
|
+
unitClickEvent?: EventEmit<{
|
|
91
|
+
unitId: string;
|
|
92
|
+
}>;
|
|
93
|
+
/** Emits UI:{tileHoverEvent} with the unprojected scene { x, y } on hover. */
|
|
94
|
+
tileHoverEvent?: EventEmit<{
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
}>;
|
|
98
|
+
/** Emits UI:{tileLeaveEvent} with {} on pointer leave. */
|
|
99
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
100
|
+
/** Maps a keydown `e.code` → the board's SEMANTIC event (device-agnostic input). */
|
|
101
|
+
keyMap?: Record<string, string>;
|
|
102
|
+
/** Maps a keyup `e.code` → the board's SEMANTIC event. */
|
|
103
|
+
keyUpMap?: Record<string, string>;
|
|
104
|
+
/** Camera behavior (default 'pan-zoom'). */
|
|
105
|
+
camera?: CameraMode;
|
|
106
|
+
/** Render scale (0.4 = 40% zoom). Ignored by `free`/`side` (world-pixel-direct). */
|
|
107
|
+
scale?: number;
|
|
108
|
+
/** Toggle minimap overlay. */
|
|
109
|
+
showMinimap?: boolean;
|
|
110
|
+
/** Follow-camera target in scene space (the neutral core `Camera.target`). When
|
|
111
|
+
* `camera:'follow'` the host lerps to keep this point centered. */
|
|
112
|
+
followTarget?: ScenePos;
|
|
113
|
+
/** Solid backdrop colour (drawn when no `backgroundImage`). */
|
|
114
|
+
bgColor?: string;
|
|
115
|
+
}
|
|
116
|
+
export declare function Canvas2D({ className, isLoading, error, projection, drawables, backgroundImage: backgroundImageRaw, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, keyMap, keyUpMap, camera, scale, showMinimap, followTarget, bgColor, }: Canvas2DProps): React.JSX.Element;
|
|
117
|
+
export declare namespace Canvas2D {
|
|
118
|
+
var displayName: string;
|
|
119
|
+
}
|
|
120
|
+
export default Canvas2D;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { EventEmit, Asset } from '@almadar/core';
|
|
3
|
-
import type { IconInput } from '
|
|
3
|
+
import type { IconInput } from '../../core/atoms/index';
|
|
4
4
|
export type ControlGridKind = 'dpad' | 'actions';
|
|
5
5
|
export interface ControlGridButton {
|
|
6
6
|
id: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-shape-layer` — batch of shapes in one descriptor for O(layers) perf.
|
|
3
|
+
*
|
|
4
|
+
* Composes the `draw-shape` atom; drawable-by-composition (its `items` are
|
|
5
|
+
* `draw-shape` descriptors, each grounded in core `ScenePos`). The React
|
|
6
|
+
* component renders `null` (a drawable is painted by the host, not the DOM).
|
|
7
|
+
*/
|
|
8
|
+
import type React from 'react';
|
|
9
|
+
import type { DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
10
|
+
import { type DrawShapeProps } from '../atoms/DrawShape';
|
|
11
|
+
export interface DrawShapeLayerProps extends DrawableBase {
|
|
12
|
+
type: 'draw-shape-layer';
|
|
13
|
+
items: DrawShapeProps[];
|
|
14
|
+
}
|
|
15
|
+
/** Paint a {@link DrawShapeLayerProps}. */
|
|
16
|
+
export declare const paintShapeLayer: PaintFn<DrawShapeLayerProps>;
|
|
17
|
+
/** Registry/standalone stub — the host paints this molecule; the DOM renders nothing. */
|
|
18
|
+
export declare function DrawShapeLayer(_props: DrawShapeLayerProps): React.JSX.Element | null;
|
|
19
|
+
export default DrawShapeLayer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-sprite-layer` — batch multiple sprites in one descriptor for O(layers) rendering.
|
|
3
|
+
*
|
|
4
|
+
* Composes the `draw-sprite` atom; the layer itself carries no `position` — each
|
|
5
|
+
* item does. It is drawable-by-composition: its `items` are `draw-sprite`
|
|
6
|
+
* descriptors (each grounded in core `ScenePos`), which is what stamps the layer
|
|
7
|
+
* `drawable` at pattern-sync time.
|
|
8
|
+
*/
|
|
9
|
+
import type React from 'react';
|
|
10
|
+
import type { DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
11
|
+
import { type DrawSpriteProps } from '../atoms/DrawSprite';
|
|
12
|
+
export interface DrawSpriteLayerProps extends DrawableBase {
|
|
13
|
+
type: 'draw-sprite-layer';
|
|
14
|
+
/** Sprites painted in array order; z-ordering is the caller's responsibility. */
|
|
15
|
+
items: DrawSpriteProps[];
|
|
16
|
+
}
|
|
17
|
+
/** Paint a {@link DrawSpriteLayerProps}. Renders all sprites in order; never throws. */
|
|
18
|
+
export declare const paintSpriteLayer: PaintFn<DrawSpriteLayerProps>;
|
|
19
|
+
/** Registry/standalone stub — the host paints this molecule; the DOM renders nothing. */
|
|
20
|
+
export declare function DrawSpriteLayer(_props: DrawSpriteLayerProps): React.JSX.Element | null;
|
|
21
|
+
export default DrawSpriteLayer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `draw-text-layer` — batch of text labels in one descriptor for O(layers) perf.
|
|
3
|
+
*
|
|
4
|
+
* Composes the `draw-text` atom; drawable-by-composition (its `items` are
|
|
5
|
+
* `draw-text` descriptors, each grounded in core `ScenePos`). Covers the batched
|
|
6
|
+
* world-space text pass — fx messages, damage numbers, unit labels — that a
|
|
7
|
+
* board maps from an entity array (`items: (array/map @entity.fx (fn ...))`),
|
|
8
|
+
* which a literal `children` array can't express. The React component renders
|
|
9
|
+
* `null` (a drawable is painted by the host, not the DOM).
|
|
10
|
+
*/
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
import type { DrawableBase, PaintFn } from '../../../lib/drawable/contract';
|
|
13
|
+
import { type DrawTextProps } from '../atoms/DrawText';
|
|
14
|
+
export interface DrawTextLayerProps extends DrawableBase {
|
|
15
|
+
type: 'draw-text-layer';
|
|
16
|
+
items: DrawTextProps[];
|
|
17
|
+
}
|
|
18
|
+
/** Paint a {@link DrawTextLayerProps}. */
|
|
19
|
+
export declare const paintTextLayer: PaintFn<DrawTextLayerProps>;
|
|
20
|
+
/** Registry/standalone stub — the host paints this molecule; the DOM renders nothing. */
|
|
21
|
+
export declare function DrawTextLayer(_props: DrawTextLayerProps): React.JSX.Element | null;
|
|
22
|
+
export default DrawTextLayer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type StatBadgeProps } from "./StatBadge";
|
|
3
3
|
import type { Asset } from "@almadar/core";
|
|
4
|
-
import type { IconInput } from "
|
|
4
|
+
import type { IconInput } from "../../core/atoms/index";
|
|
5
5
|
export interface GameHudStat extends Omit<StatBadgeProps, "size"> {
|
|
6
6
|
/** Data source entity name */
|
|
7
7
|
source?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type IconInput } from '
|
|
2
|
+
import { type IconInput } from '../../core/atoms/Icon';
|
|
3
3
|
import type { Asset } from '@almadar/core';
|
|
4
4
|
/**
|
|
5
5
|
* StatBadge — game stat display molecule (distinct from core Badge atom).
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import type { Asset, EventEmit } from '@almadar/core';
|
|
22
22
|
import { type TraitStateMachineDefinition } from './TraitStateViewer';
|
|
23
|
-
import type { UiError } from '
|
|
23
|
+
import type { UiError } from '../../core/atoms/types';
|
|
24
24
|
/** Data shape for a slot's equipped item */
|
|
25
25
|
export type SlotItemData = {
|
|
26
26
|
id: string;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { type StateStyle } from '../atoms/StateIndicator';
|
|
14
|
-
import type { UiError } from '
|
|
14
|
+
import type { UiError } from '../../core/atoms/types';
|
|
15
15
|
export type TraitTransition = {
|
|
16
16
|
from: string;
|
|
17
17
|
to: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { Point } from '
|
|
10
|
+
import type { Point } from '../../core/atoms/types';
|
|
11
11
|
export interface TransitionArrowProps {
|
|
12
12
|
/** Start position (center of from-node) */
|
|
13
13
|
from: Point;
|