@ai-game-assets/phaser 0.6.0 → 0.8.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.
Files changed (49) hide show
  1. package/dist/animations.d.ts +2 -0
  2. package/dist/animations.d.ts.map +1 -1
  3. package/dist/animations.js +4 -3
  4. package/dist/animations.js.map +1 -1
  5. package/dist/debug-client.d.ts +55 -2
  6. package/dist/debug-client.d.ts.map +1 -1
  7. package/dist/debug-client.js +77 -0
  8. package/dist/debug-client.js.map +1 -1
  9. package/dist/designer-support.d.ts +29 -3
  10. package/dist/designer-support.d.ts.map +1 -1
  11. package/dist/designer-support.js +557 -29
  12. package/dist/designer-support.js.map +1 -1
  13. package/dist/designer.d.ts +19 -2
  14. package/dist/designer.d.ts.map +1 -1
  15. package/dist/designer.js +1897 -143
  16. package/dist/designer.js.map +1 -1
  17. package/dist/first-drafts.d.ts.map +1 -1
  18. package/dist/first-drafts.js +68 -40
  19. package/dist/first-drafts.js.map +1 -1
  20. package/dist/index.d.ts +9 -3
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/keys.d.ts +2 -0
  25. package/dist/keys.d.ts.map +1 -1
  26. package/dist/keys.js +6 -0
  27. package/dist/keys.js.map +1 -1
  28. package/dist/loader.d.ts.map +1 -1
  29. package/dist/loader.js +50 -3
  30. package/dist/loader.js.map +1 -1
  31. package/dist/phaser-types.d.ts +1 -0
  32. package/dist/phaser-types.d.ts.map +1 -1
  33. package/dist/runtime.d.ts +30 -2
  34. package/dist/runtime.d.ts.map +1 -1
  35. package/dist/runtime.js +235 -8
  36. package/dist/runtime.js.map +1 -1
  37. package/dist/tileset-dialog.d.ts +121 -0
  38. package/dist/tileset-dialog.d.ts.map +1 -0
  39. package/dist/tileset-dialog.js +1594 -0
  40. package/dist/tileset-dialog.js.map +1 -0
  41. package/dist/tilesets.d.ts +13 -0
  42. package/dist/tilesets.d.ts.map +1 -0
  43. package/dist/tilesets.js +60 -0
  44. package/dist/tilesets.js.map +1 -0
  45. package/dist/voice-line-regeneration.d.ts +47 -0
  46. package/dist/voice-line-regeneration.d.ts.map +1 -0
  47. package/dist/voice-line-regeneration.js +185 -0
  48. package/dist/voice-line-regeneration.js.map +1 -0
  49. package/package.json +3 -2
@@ -0,0 +1,121 @@
1
+ import type { AiAssetDefinition, AiAssetTileset, AiTilesetAnimation, AiTilesetTileTransform } from "@ai-game-assets/core";
2
+ import type { GeneratedDebugOption, GeneratedTilesetAnimationCandidate } from "./debug-client.js";
3
+ export type DesignerTilesetAnimation = AiTilesetAnimation;
4
+ export type DesignerTilesetMetadata = AiAssetTileset;
5
+ export type TilesetMixSelection = "base" | number;
6
+ export type TilesetAnimationMixResult = {
7
+ animationKey: string;
8
+ frames: string[];
9
+ selections: TilesetMixSelection[];
10
+ };
11
+ export type TilesetBaseMixResult = {
12
+ dataUrl: string;
13
+ dimensions: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ tileset: DesignerTilesetMetadata;
18
+ selections: TilesetMixSelection[];
19
+ };
20
+ export type TilesetBaseMixPlan = {
21
+ dimensions: TilesetBaseMixResult["dimensions"];
22
+ tileset: DesignerTilesetMetadata;
23
+ selections: TilesetMixSelection[];
24
+ };
25
+ export type TilesetBaseMixCurrent = {
26
+ asset: AiAssetDefinition;
27
+ sheetSrc: string;
28
+ };
29
+ export type TilesetEditorResult = {
30
+ dataUrl: string;
31
+ sourceDataUrl: string;
32
+ transforms: AiTilesetTileTransform[];
33
+ };
34
+ export type TilesetTileTransform = AiTilesetTileTransform;
35
+ export type TilesetTileTransformDrawPlan = {
36
+ source: {
37
+ x: number;
38
+ y: number;
39
+ width: number;
40
+ height: number;
41
+ };
42
+ clip: {
43
+ x: number;
44
+ y: number;
45
+ width: number;
46
+ height: number;
47
+ };
48
+ destination: {
49
+ x: number;
50
+ y: number;
51
+ width: number;
52
+ height: number;
53
+ };
54
+ };
55
+ export declare function normalizeTilesetTileTransform(transform: Partial<TilesetTileTransform> | undefined): TilesetTileTransform;
56
+ /**
57
+ * Builds the source, clipping, and destination rectangles used to render one
58
+ * transformed tile. Scaling is centered on the tile before its pixel offset is
59
+ * applied, and clipping always stays fixed to the tile cell.
60
+ */
61
+ export declare function tilesetTileTransformDrawPlan(tileset: DesignerTilesetMetadata, tile: number, transform: Partial<TilesetTileTransform> | undefined): TilesetTileTransformDrawPlan;
62
+ export type TilesetAnimationEditorResult = {
63
+ frames: string[];
64
+ animation: AiTilesetAnimation;
65
+ };
66
+ export type TilesetTileGenerationOverride = Pick<DesignerTilesetMetadata, "tileWidth" | "tileHeight" | "columns" | "rows" | "tileCount" | "tiles">;
67
+ export declare function resolveTilesetBaseMixCurrent(asset: AiAssetDefinition, activeSheetSrc: string, currentOption?: GeneratedDebugOption): TilesetBaseMixCurrent;
68
+ export declare function tilesetTileGenerationOverride(tileset: DesignerTilesetMetadata, tile: number): TilesetTileGenerationOverride;
69
+ export declare function createMixedTilesetOption(template: GeneratedDebugOption, result: TilesetBaseMixResult, prompt: string, index?: number): GeneratedDebugOption;
70
+ export declare function isDesignerTilesetAsset(asset: AiAssetDefinition | undefined): boolean;
71
+ export declare function tilesetMetadataForAsset(asset: AiAssetDefinition | undefined): DesignerTilesetMetadata | undefined;
72
+ export declare function tilesetAnimationForKey(asset: AiAssetDefinition | undefined, animationKey: string): DesignerTilesetAnimation | undefined;
73
+ export declare function tilesetTilePrompt(tileset: DesignerTilesetMetadata | undefined, tile: number): string | undefined;
74
+ export declare function tilesetAnimationWithFrameDelays(animation: AiTilesetAnimation, frameDelays: number[]): AiTilesetAnimation;
75
+ /**
76
+ * Resolves the generated base sheet geometry and the initial per-tile choices.
77
+ * Existing tile indexes keep the current tile by default. New indexes, which
78
+ * have no current tile to keep, default to the first generated option.
79
+ */
80
+ export declare function planTilesetBaseMix(asset: AiAssetDefinition, candidates: GeneratedDebugOption[]): TilesetBaseMixPlan;
81
+ export declare function openTilesetEditor(options: {
82
+ root: HTMLElement;
83
+ asset: AiAssetDefinition;
84
+ assetId: string;
85
+ src: string;
86
+ sourceSrc?: string;
87
+ initialTransforms?: AiTilesetTileTransform[];
88
+ regenerateTile(tile: number, tileset: TilesetTileGenerationOverride, currentTileSrc: string): Promise<GeneratedDebugOption[]>;
89
+ onConfirm(result: TilesetEditorResult): void | Promise<void>;
90
+ }): Promise<void>;
91
+ export declare function openTilesetAnimationEditor(options: {
92
+ root: HTMLElement;
93
+ asset: AiAssetDefinition;
94
+ assetId: string;
95
+ animationKey: string;
96
+ frames: string[];
97
+ onConfirm(result: TilesetAnimationEditorResult): void | Promise<void>;
98
+ }): Promise<void>;
99
+ export declare function openTilesetBaseMixerDialog(options: {
100
+ root: HTMLElement;
101
+ asset: AiAssetDefinition;
102
+ assetId: string;
103
+ baseSheetSrc: string;
104
+ candidates: GeneratedDebugOption[];
105
+ regenerateTile?(tile: number, tileset: TilesetTileGenerationOverride, currentTileSrc: string): Promise<GeneratedDebugOption[]>;
106
+ }): Promise<TilesetBaseMixResult | undefined>;
107
+ export declare function openTilesetAnimationMixerDialog(options: {
108
+ root: HTMLElement;
109
+ asset: AiAssetDefinition;
110
+ assetId: string;
111
+ animationKey: string;
112
+ baseSheetSrc: string;
113
+ baseAnimationFrameSrcs: string[];
114
+ candidates: GeneratedTilesetAnimationCandidate[];
115
+ initialSelections?: TilesetMixSelection[];
116
+ tilePrompts?: Array<{
117
+ prompt: string;
118
+ }>;
119
+ regenerateTile?(tile: number, currentTileSrc: string): Promise<GeneratedTilesetAnimationCandidate[]>;
120
+ }): Promise<TilesetAnimationMixResult | undefined>;
121
+ //# sourceMappingURL=tileset-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tileset-dialog.d.ts","sourceRoot":"","sources":["../src/tileset-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,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