@ankhorage/zora-game 0.2.0 → 0.3.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 (72) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +2 -1
  3. package/dist/ZORA_GAME_COMPONENT_META.d.ts +111 -1
  4. package/dist/ZORA_GAME_COMPONENT_META.d.ts.map +1 -1
  5. package/dist/ZORA_GAME_COMPONENT_META.js +2 -0
  6. package/dist/ZORA_GAME_COMPONENT_META.js.map +1 -1
  7. package/dist/ZORA_GAME_PLUGIN.d.ts +117 -2
  8. package/dist/ZORA_GAME_PLUGIN.d.ts.map +1 -1
  9. package/dist/ZORA_GAME_PLUGIN.js +2 -0
  10. package/dist/ZORA_GAME_PLUGIN.js.map +1 -1
  11. package/dist/ZORA_PLUGIN_METADATA.d.ts +115 -2
  12. package/dist/ZORA_PLUGIN_METADATA.d.ts.map +1 -1
  13. package/dist/ZORA_PLUGIN_METADATA.js +5 -1
  14. package/dist/ZORA_PLUGIN_METADATA.js.map +1 -1
  15. package/dist/features/game-presentation/adapters/inbound/GameEntity.d.ts.map +1 -1
  16. package/dist/features/game-presentation/adapters/inbound/GameEntity.js +4 -11
  17. package/dist/features/game-presentation/adapters/inbound/GameEntity.js.map +1 -1
  18. package/dist/features/game-presentation/adapters/inbound/GameInputZone.d.ts +4 -0
  19. package/dist/features/game-presentation/adapters/inbound/GameInputZone.d.ts.map +1 -0
  20. package/dist/features/game-presentation/adapters/inbound/GameInputZone.js +35 -0
  21. package/dist/features/game-presentation/adapters/inbound/GameInputZone.js.map +1 -0
  22. package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.d.ts +17 -0
  23. package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.d.ts.map +1 -0
  24. package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.js +20 -0
  25. package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.js.map +1 -0
  26. package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.d.ts +9 -0
  27. package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.d.ts.map +1 -0
  28. package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.js +37 -0
  29. package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.js.map +1 -0
  30. package/dist/features/game-presentation/meta/gameInputZoneMeta.d.ts +112 -0
  31. package/dist/features/game-presentation/meta/gameInputZoneMeta.d.ts.map +1 -0
  32. package/dist/features/game-presentation/meta/gameInputZoneMeta.js +92 -0
  33. package/dist/features/game-presentation/meta/gameInputZoneMeta.js.map +1 -0
  34. package/dist/features/game-presentation/meta/gameMeta.d.ts +1 -1
  35. package/dist/features/game-presentation/meta/gameMeta.js +1 -1
  36. package/dist/features/game-presentation/meta/gameMeta.js.map +1 -1
  37. package/dist/features/game-presentation/public.d.ts +2 -1
  38. package/dist/features/game-presentation/public.d.ts.map +1 -1
  39. package/dist/features/game-presentation/public.js +1 -0
  40. package/dist/features/game-presentation/public.js.map +1 -1
  41. package/dist/features/game-presentation/utils/clampGamePercentage.d.ts +3 -0
  42. package/dist/features/game-presentation/utils/clampGamePercentage.d.ts.map +1 -0
  43. package/dist/features/game-presentation/utils/clampGamePercentage.js +5 -0
  44. package/dist/features/game-presentation/utils/clampGamePercentage.js.map +1 -0
  45. package/dist/features/game-presentation/utils/toGamePercentage.d.ts +3 -0
  46. package/dist/features/game-presentation/utils/toGamePercentage.d.ts.map +1 -0
  47. package/dist/features/game-presentation/utils/toGamePercentage.js +6 -0
  48. package/dist/features/game-presentation/utils/toGamePercentage.js.map +1 -0
  49. package/dist/index.d.ts +2 -2
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/types/gamePresentation.d.ts +13 -0
  54. package/dist/types/gamePresentation.d.ts.map +1 -1
  55. package/dist/types/gamePresentation.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/ZORA_GAME_COMPONENT_META.ts +2 -0
  58. package/src/ZORA_GAME_PLUGIN.ts +2 -0
  59. package/src/ZORA_PLUGIN_METADATA.test.ts +11 -0
  60. package/src/ZORA_PLUGIN_METADATA.ts +5 -1
  61. package/src/features/game-presentation/adapters/inbound/GameEntity.tsx +4 -13
  62. package/src/features/game-presentation/adapters/inbound/GameInputZone.tsx +70 -0
  63. package/src/features/game-presentation/adapters/inbound/createGamePointerEvent.test.ts +56 -0
  64. package/src/features/game-presentation/adapters/inbound/createGamePointerEvent.ts +39 -0
  65. package/src/features/game-presentation/adapters/inbound/useGameInputZoneResponder.ts +49 -0
  66. package/src/features/game-presentation/meta/gameInputZoneMeta.ts +94 -0
  67. package/src/features/game-presentation/meta/gameMeta.ts +1 -1
  68. package/src/features/game-presentation/public.ts +2 -0
  69. package/src/features/game-presentation/utils/clampGamePercentage.ts +4 -0
  70. package/src/features/game-presentation/utils/toGamePercentage.ts +6 -0
  71. package/src/index.ts +8 -1
  72. package/src/types/gamePresentation.ts +14 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @ankhorage/zora-game
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ee7760c: Add a generic field-relative pointer and touch input-zone adapter that dispatches normalized events
8
+ into the embeddable Game runtime without owning gameplay rules.
9
+
3
10
  ## 0.2.0
4
11
 
5
12
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/zora-game
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Generic game presentation primitives for React Native and React Native Web apps built on ZORA.
9
9
 
@@ -17,4 +17,5 @@ Generic game presentation primitives for React Native and React Native Web apps
17
17
  - [Export graph](././paradox/diagrams/export-graph.mmd)
18
18
  - [Game sequence](././paradox/diagrams/sequences/game.mmd)
19
19
  - [GameEntity sequence](././paradox/diagrams/sequences/game-entity.mmd)
20
+ - [GameInputZone sequence](././paradox/diagrams/sequences/game-input-zone.mmd)
20
21
  - [GameOverlay sequence](././paradox/diagrams/sequences/game-overlay.mmd)
@@ -5,7 +5,7 @@ export declare const ZORA_GAME_COMPONENT_META: {
5
5
  readonly category: "pattern";
6
6
  readonly description: "Embeds one config-driven game session inside ordinary ZORA layout and emits domain-neutral game outputs.";
7
7
  readonly directManifestNode: true;
8
- readonly allowedChildren: readonly ["GameEntity", "GameOverlay", "Gradient", "Image", "View"];
8
+ readonly allowedChildren: readonly ["GameEntity", "GameInputZone", "GameOverlay", "Gradient", "Image", "View"];
9
9
  readonly blueprint: {
10
10
  readonly label: "Game";
11
11
  readonly defaultProps: {
@@ -285,6 +285,116 @@ export declare const ZORA_GAME_COMPONENT_META: {
285
285
  };
286
286
  };
287
287
  };
288
+ readonly GameInputZone: {
289
+ readonly name: "GameInputZone";
290
+ readonly category: "component";
291
+ readonly description: "Normalizes pointer and touch positions into field-relative percentages and dispatches a generic game event.";
292
+ readonly directManifestNode: true;
293
+ readonly allowedChildren: readonly [];
294
+ readonly blueprint: {
295
+ readonly label: "Game input zone";
296
+ readonly defaultProps: {
297
+ readonly eventType: "game.pointer";
298
+ readonly x: 0;
299
+ readonly y: 0;
300
+ readonly width: 100;
301
+ readonly height: 100;
302
+ readonly zIndex: 1;
303
+ readonly enabled: true;
304
+ readonly continuous: true;
305
+ };
306
+ };
307
+ readonly props: {
308
+ readonly eventType: {
309
+ readonly type: "string";
310
+ readonly category: "Input";
311
+ readonly label: "Game event type";
312
+ readonly default: "game.pointer";
313
+ readonly authoring: {
314
+ readonly authority: "instance";
315
+ };
316
+ };
317
+ readonly entityId: {
318
+ readonly type: "string";
319
+ readonly category: "Input";
320
+ readonly label: "Entity id";
321
+ readonly authoring: {
322
+ readonly authority: "instance";
323
+ };
324
+ };
325
+ readonly x: {
326
+ readonly type: "number";
327
+ readonly category: "Position";
328
+ readonly label: "X (%)";
329
+ readonly default: 0;
330
+ readonly authoring: {
331
+ readonly authority: "instance";
332
+ };
333
+ };
334
+ readonly y: {
335
+ readonly type: "number";
336
+ readonly category: "Position";
337
+ readonly label: "Y (%)";
338
+ readonly default: 0;
339
+ readonly authoring: {
340
+ readonly authority: "instance";
341
+ };
342
+ };
343
+ readonly width: {
344
+ readonly type: "number";
345
+ readonly category: "Size";
346
+ readonly label: "Width (%)";
347
+ readonly default: 100;
348
+ readonly authoring: {
349
+ readonly authority: "instance";
350
+ };
351
+ };
352
+ readonly height: {
353
+ readonly type: "number";
354
+ readonly category: "Size";
355
+ readonly label: "Height (%)";
356
+ readonly default: 100;
357
+ readonly authoring: {
358
+ readonly authority: "instance";
359
+ };
360
+ };
361
+ readonly zIndex: {
362
+ readonly type: "number";
363
+ readonly category: "Position";
364
+ readonly label: "Z index";
365
+ readonly default: 1;
366
+ readonly authoring: {
367
+ readonly authority: "instance";
368
+ };
369
+ };
370
+ readonly enabled: {
371
+ readonly type: "boolean";
372
+ readonly category: "State";
373
+ readonly label: "Enabled";
374
+ readonly default: true;
375
+ readonly authoring: {
376
+ readonly authority: "instance";
377
+ };
378
+ };
379
+ readonly continuous: {
380
+ readonly type: "boolean";
381
+ readonly category: "Input";
382
+ readonly label: "Dispatch while moving";
383
+ readonly default: true;
384
+ readonly authoring: {
385
+ readonly authority: "instance";
386
+ };
387
+ };
388
+ readonly accessibilityLabel: {
389
+ readonly type: "string";
390
+ readonly category: "Accessibility";
391
+ readonly label: "Accessibility label";
392
+ readonly authoring: {
393
+ readonly authority: "instance";
394
+ };
395
+ };
396
+ };
397
+ };
288
398
  readonly GameOverlay: {
289
399
  readonly name: "GameOverlay";
290
400
  readonly category: "layout";
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_GAME_COMPONENT_META.d.ts","sourceRoot":"","sources":["../src/ZORA_GAME_COMPONENT_META.ts"],"names":[],"mappings":"AAKA,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3B,CAAC"}
1
+ {"version":3,"file":"ZORA_GAME_COMPONENT_META.d.ts","sourceRoot":"","sources":["../src/ZORA_GAME_COMPONENT_META.ts"],"names":[],"mappings":"AAMA,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM3B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { gameEntityMeta } from './features/game-presentation/meta/gameEntityMeta';
2
2
  import { gameFieldMeta } from './features/game-presentation/meta/gameFieldMeta';
3
+ import { gameInputZoneMeta } from './features/game-presentation/meta/gameInputZoneMeta';
3
4
  import { gameMeta } from './features/game-presentation/meta/gameMeta';
4
5
  import { gameOverlayMeta } from './features/game-presentation/meta/gameOverlayMeta';
5
6
  /*** Register the generic game presentation metadata owned by this package. */
@@ -7,6 +8,7 @@ export const ZORA_GAME_COMPONENT_META = {
7
8
  Game: gameMeta,
8
9
  GameEntity: gameEntityMeta,
9
10
  GameField: gameFieldMeta,
11
+ GameInputZone: gameInputZoneMeta,
10
12
  GameOverlay: gameOverlayMeta,
11
13
  };
12
14
  //# sourceMappingURL=ZORA_GAME_COMPONENT_META.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_GAME_COMPONENT_META.js","sourceRoot":"","sources":["../src/ZORA_GAME_COMPONENT_META.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,eAAe;CACpB,CAAC","sourcesContent":["import { gameEntityMeta } from './features/game-presentation/meta/gameEntityMeta';\nimport { gameFieldMeta } from './features/game-presentation/meta/gameFieldMeta';\nimport { gameMeta } from './features/game-presentation/meta/gameMeta';\nimport { gameOverlayMeta } from './features/game-presentation/meta/gameOverlayMeta';\n\n/*** Register the generic game presentation metadata owned by this package. */\nexport const ZORA_GAME_COMPONENT_META = {\n Game: gameMeta,\n GameEntity: gameEntityMeta,\n GameField: gameFieldMeta,\n GameOverlay: gameOverlayMeta,\n} as const;\n"]}
1
+ {"version":3,"file":"ZORA_GAME_COMPONENT_META.js","sourceRoot":"","sources":["../src/ZORA_GAME_COMPONENT_META.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,iBAAiB;IAChC,WAAW,EAAE,eAAe;CACpB,CAAC","sourcesContent":["import { gameEntityMeta } from './features/game-presentation/meta/gameEntityMeta';\nimport { gameFieldMeta } from './features/game-presentation/meta/gameFieldMeta';\nimport { gameInputZoneMeta } from './features/game-presentation/meta/gameInputZoneMeta';\nimport { gameMeta } from './features/game-presentation/meta/gameMeta';\nimport { gameOverlayMeta } from './features/game-presentation/meta/gameOverlayMeta';\n\n/*** Register the generic game presentation metadata owned by this package. */\nexport const ZORA_GAME_COMPONENT_META = {\n Game: gameMeta,\n GameEntity: gameEntityMeta,\n GameField: gameFieldMeta,\n GameInputZone: gameInputZoneMeta,\n GameOverlay: gameOverlayMeta,\n} as const;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Game } from './features/game-presentation/adapters/inbound/Game';
2
2
  import { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';
3
3
  import { GameField } from './features/game-presentation/adapters/inbound/GameField';
4
+ import { GameInputZone } from './features/game-presentation/adapters/inbound/GameInputZone';
4
5
  import { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';
5
6
  /*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */
6
7
  export declare const ZORA_GAME_PLUGIN: {
@@ -8,6 +9,7 @@ export declare const ZORA_GAME_PLUGIN: {
8
9
  readonly Game: typeof Game;
9
10
  readonly GameEntity: typeof GameEntity;
10
11
  readonly GameField: typeof GameField;
12
+ readonly GameInputZone: typeof GameInputZone;
11
13
  readonly GameOverlay: typeof GameOverlay;
12
14
  };
13
15
  readonly packageName: "@ankhorage/zora-game";
@@ -18,7 +20,7 @@ export declare const ZORA_GAME_PLUGIN: {
18
20
  readonly category: "pattern";
19
21
  readonly description: "Embeds one config-driven game session inside ordinary ZORA layout and emits domain-neutral game outputs.";
20
22
  readonly directManifestNode: true;
21
- readonly allowedChildren: readonly ["GameEntity", "GameOverlay", "Gradient", "Image", "View"];
23
+ readonly allowedChildren: readonly ["GameEntity", "GameInputZone", "GameOverlay", "Gradient", "Image", "View"];
22
24
  readonly blueprint: {
23
25
  readonly label: "Game";
24
26
  readonly defaultProps: {
@@ -298,6 +300,116 @@ export declare const ZORA_GAME_PLUGIN: {
298
300
  };
299
301
  };
300
302
  };
303
+ readonly GameInputZone: {
304
+ readonly name: "GameInputZone";
305
+ readonly category: "component";
306
+ readonly description: "Normalizes pointer and touch positions into field-relative percentages and dispatches a generic game event.";
307
+ readonly directManifestNode: true;
308
+ readonly allowedChildren: readonly [];
309
+ readonly blueprint: {
310
+ readonly label: "Game input zone";
311
+ readonly defaultProps: {
312
+ readonly eventType: "game.pointer";
313
+ readonly x: 0;
314
+ readonly y: 0;
315
+ readonly width: 100;
316
+ readonly height: 100;
317
+ readonly zIndex: 1;
318
+ readonly enabled: true;
319
+ readonly continuous: true;
320
+ };
321
+ };
322
+ readonly props: {
323
+ readonly eventType: {
324
+ readonly type: "string";
325
+ readonly category: "Input";
326
+ readonly label: "Game event type";
327
+ readonly default: "game.pointer";
328
+ readonly authoring: {
329
+ readonly authority: "instance";
330
+ };
331
+ };
332
+ readonly entityId: {
333
+ readonly type: "string";
334
+ readonly category: "Input";
335
+ readonly label: "Entity id";
336
+ readonly authoring: {
337
+ readonly authority: "instance";
338
+ };
339
+ };
340
+ readonly x: {
341
+ readonly type: "number";
342
+ readonly category: "Position";
343
+ readonly label: "X (%)";
344
+ readonly default: 0;
345
+ readonly authoring: {
346
+ readonly authority: "instance";
347
+ };
348
+ };
349
+ readonly y: {
350
+ readonly type: "number";
351
+ readonly category: "Position";
352
+ readonly label: "Y (%)";
353
+ readonly default: 0;
354
+ readonly authoring: {
355
+ readonly authority: "instance";
356
+ };
357
+ };
358
+ readonly width: {
359
+ readonly type: "number";
360
+ readonly category: "Size";
361
+ readonly label: "Width (%)";
362
+ readonly default: 100;
363
+ readonly authoring: {
364
+ readonly authority: "instance";
365
+ };
366
+ };
367
+ readonly height: {
368
+ readonly type: "number";
369
+ readonly category: "Size";
370
+ readonly label: "Height (%)";
371
+ readonly default: 100;
372
+ readonly authoring: {
373
+ readonly authority: "instance";
374
+ };
375
+ };
376
+ readonly zIndex: {
377
+ readonly type: "number";
378
+ readonly category: "Position";
379
+ readonly label: "Z index";
380
+ readonly default: 1;
381
+ readonly authoring: {
382
+ readonly authority: "instance";
383
+ };
384
+ };
385
+ readonly enabled: {
386
+ readonly type: "boolean";
387
+ readonly category: "State";
388
+ readonly label: "Enabled";
389
+ readonly default: true;
390
+ readonly authoring: {
391
+ readonly authority: "instance";
392
+ };
393
+ };
394
+ readonly continuous: {
395
+ readonly type: "boolean";
396
+ readonly category: "Input";
397
+ readonly label: "Dispatch while moving";
398
+ readonly default: true;
399
+ readonly authoring: {
400
+ readonly authority: "instance";
401
+ };
402
+ };
403
+ readonly accessibilityLabel: {
404
+ readonly type: "string";
405
+ readonly category: "Accessibility";
406
+ readonly label: "Accessibility label";
407
+ readonly authoring: {
408
+ readonly authority: "instance";
409
+ };
410
+ };
411
+ };
412
+ };
301
413
  readonly GameOverlay: {
302
414
  readonly name: "GameOverlay";
303
415
  readonly category: "layout";
@@ -352,7 +464,7 @@ export declare const ZORA_GAME_PLUGIN: {
352
464
  };
353
465
  };
354
466
  };
355
- readonly extensionHosts: readonly ["Game", "GameField", "GameEntity", "GameOverlay"];
467
+ readonly extensionHosts: readonly ["Game", "GameEntity", "GameField", "GameInputZone", "GameOverlay"];
356
468
  readonly placements: readonly [{
357
469
  readonly child: "Game";
358
470
  readonly parents: readonly ["Card", "Grid", "Screen", "ScreenSection", "View"];
@@ -362,6 +474,9 @@ export declare const ZORA_GAME_PLUGIN: {
362
474
  }, {
363
475
  readonly child: "GameEntity";
364
476
  readonly parents: readonly ["Game", "GameField", "GameOverlay"];
477
+ }, {
478
+ readonly child: "GameInputZone";
479
+ readonly parents: readonly ["Game"];
365
480
  }, {
366
481
  readonly child: "GameOverlay";
367
482
  readonly parents: readonly ["Game", "GameField"];
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_GAME_PLUGIN.d.ts","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,yDAAyD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAGxF,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnB,CAAC"}
1
+ {"version":3,"file":"ZORA_GAME_PLUGIN.d.ts","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,yDAAyD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAGxF,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASnB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Game } from './features/game-presentation/adapters/inbound/Game';
2
2
  import { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';
3
3
  import { GameField } from './features/game-presentation/adapters/inbound/GameField';
4
+ import { GameInputZone } from './features/game-presentation/adapters/inbound/GameInputZone';
4
5
  import { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';
5
6
  import { ZORA_PLUGIN_METADATA } from './ZORA_PLUGIN_METADATA';
6
7
  /*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */
@@ -10,6 +11,7 @@ export const ZORA_GAME_PLUGIN = {
10
11
  Game,
11
12
  GameEntity,
12
13
  GameField,
14
+ GameInputZone,
13
15
  GameOverlay,
14
16
  },
15
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_GAME_PLUGIN.js","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,yDAAyD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,oBAAoB;IACvB,iBAAiB,EAAE;QACjB,IAAI;QACJ,UAAU;QACV,SAAS;QACT,WAAW;KACZ;CACO,CAAC","sourcesContent":["import { Game } from './features/game-presentation/adapters/inbound/Game';\nimport { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';\nimport { GameField } from './features/game-presentation/adapters/inbound/GameField';\nimport { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';\nimport { ZORA_PLUGIN_METADATA } from './ZORA_PLUGIN_METADATA';\n\n/*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */\nexport const ZORA_GAME_PLUGIN = {\n ...ZORA_PLUGIN_METADATA,\n componentRegistry: {\n Game,\n GameEntity,\n GameField,\n GameOverlay,\n },\n} as const;\n"]}
1
+ {"version":3,"file":"ZORA_GAME_PLUGIN.js","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,yDAAyD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,oBAAoB;IACvB,iBAAiB,EAAE;QACjB,IAAI;QACJ,UAAU;QACV,SAAS;QACT,aAAa;QACb,WAAW;KACZ;CACO,CAAC","sourcesContent":["import { Game } from './features/game-presentation/adapters/inbound/Game';\nimport { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';\nimport { GameField } from './features/game-presentation/adapters/inbound/GameField';\nimport { GameInputZone } from './features/game-presentation/adapters/inbound/GameInputZone';\nimport { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';\nimport { ZORA_PLUGIN_METADATA } from './ZORA_PLUGIN_METADATA';\n\n/*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */\nexport const ZORA_GAME_PLUGIN = {\n ...ZORA_PLUGIN_METADATA,\n componentRegistry: {\n Game,\n GameEntity,\n GameField,\n GameInputZone,\n GameOverlay,\n },\n} as const;\n"]}
@@ -8,7 +8,7 @@ export declare const ZORA_PLUGIN_METADATA: {
8
8
  readonly category: "pattern";
9
9
  readonly description: "Embeds one config-driven game session inside ordinary ZORA layout and emits domain-neutral game outputs.";
10
10
  readonly directManifestNode: true;
11
- readonly allowedChildren: readonly ["GameEntity", "GameOverlay", "Gradient", "Image", "View"];
11
+ readonly allowedChildren: readonly ["GameEntity", "GameInputZone", "GameOverlay", "Gradient", "Image", "View"];
12
12
  readonly blueprint: {
13
13
  readonly label: "Game";
14
14
  readonly defaultProps: {
@@ -288,6 +288,116 @@ export declare const ZORA_PLUGIN_METADATA: {
288
288
  };
289
289
  };
290
290
  };
291
+ readonly GameInputZone: {
292
+ readonly name: "GameInputZone";
293
+ readonly category: "component";
294
+ readonly description: "Normalizes pointer and touch positions into field-relative percentages and dispatches a generic game event.";
295
+ readonly directManifestNode: true;
296
+ readonly allowedChildren: readonly [];
297
+ readonly blueprint: {
298
+ readonly label: "Game input zone";
299
+ readonly defaultProps: {
300
+ readonly eventType: "game.pointer";
301
+ readonly x: 0;
302
+ readonly y: 0;
303
+ readonly width: 100;
304
+ readonly height: 100;
305
+ readonly zIndex: 1;
306
+ readonly enabled: true;
307
+ readonly continuous: true;
308
+ };
309
+ };
310
+ readonly props: {
311
+ readonly eventType: {
312
+ readonly type: "string";
313
+ readonly category: "Input";
314
+ readonly label: "Game event type";
315
+ readonly default: "game.pointer";
316
+ readonly authoring: {
317
+ readonly authority: "instance";
318
+ };
319
+ };
320
+ readonly entityId: {
321
+ readonly type: "string";
322
+ readonly category: "Input";
323
+ readonly label: "Entity id";
324
+ readonly authoring: {
325
+ readonly authority: "instance";
326
+ };
327
+ };
328
+ readonly x: {
329
+ readonly type: "number";
330
+ readonly category: "Position";
331
+ readonly label: "X (%)";
332
+ readonly default: 0;
333
+ readonly authoring: {
334
+ readonly authority: "instance";
335
+ };
336
+ };
337
+ readonly y: {
338
+ readonly type: "number";
339
+ readonly category: "Position";
340
+ readonly label: "Y (%)";
341
+ readonly default: 0;
342
+ readonly authoring: {
343
+ readonly authority: "instance";
344
+ };
345
+ };
346
+ readonly width: {
347
+ readonly type: "number";
348
+ readonly category: "Size";
349
+ readonly label: "Width (%)";
350
+ readonly default: 100;
351
+ readonly authoring: {
352
+ readonly authority: "instance";
353
+ };
354
+ };
355
+ readonly height: {
356
+ readonly type: "number";
357
+ readonly category: "Size";
358
+ readonly label: "Height (%)";
359
+ readonly default: 100;
360
+ readonly authoring: {
361
+ readonly authority: "instance";
362
+ };
363
+ };
364
+ readonly zIndex: {
365
+ readonly type: "number";
366
+ readonly category: "Position";
367
+ readonly label: "Z index";
368
+ readonly default: 1;
369
+ readonly authoring: {
370
+ readonly authority: "instance";
371
+ };
372
+ };
373
+ readonly enabled: {
374
+ readonly type: "boolean";
375
+ readonly category: "State";
376
+ readonly label: "Enabled";
377
+ readonly default: true;
378
+ readonly authoring: {
379
+ readonly authority: "instance";
380
+ };
381
+ };
382
+ readonly continuous: {
383
+ readonly type: "boolean";
384
+ readonly category: "Input";
385
+ readonly label: "Dispatch while moving";
386
+ readonly default: true;
387
+ readonly authoring: {
388
+ readonly authority: "instance";
389
+ };
390
+ };
391
+ readonly accessibilityLabel: {
392
+ readonly type: "string";
393
+ readonly category: "Accessibility";
394
+ readonly label: "Accessibility label";
395
+ readonly authoring: {
396
+ readonly authority: "instance";
397
+ };
398
+ };
399
+ };
400
+ };
291
401
  readonly GameOverlay: {
292
402
  readonly name: "GameOverlay";
293
403
  readonly category: "layout";
@@ -342,7 +452,7 @@ export declare const ZORA_PLUGIN_METADATA: {
342
452
  };
343
453
  };
344
454
  };
345
- readonly extensionHosts: readonly ["Game", "GameField", "GameEntity", "GameOverlay"];
455
+ readonly extensionHosts: readonly ["Game", "GameEntity", "GameField", "GameInputZone", "GameOverlay"];
346
456
  readonly placements: readonly [{
347
457
  readonly child: "Game";
348
458
  readonly parents: readonly ["Card", "Grid", "Screen", "ScreenSection", "View"];
@@ -352,6 +462,9 @@ export declare const ZORA_PLUGIN_METADATA: {
352
462
  }, {
353
463
  readonly child: "GameEntity";
354
464
  readonly parents: readonly ["Game", "GameField", "GameOverlay"];
465
+ }, {
466
+ readonly child: "GameInputZone";
467
+ readonly parents: readonly ["Game"];
355
468
  }, {
356
469
  readonly child: "GameOverlay";
357
470
  readonly parents: readonly ["Game", "GameField"];
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_PLUGIN_METADATA.d.ts","sourceRoot":"","sources":["../src/ZORA_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBM,CAAC"}
1
+ {"version":3,"file":"ZORA_PLUGIN_METADATA.d.ts","sourceRoot":"","sources":["../src/ZORA_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BM,CAAC"}
@@ -4,7 +4,7 @@ export const ZORA_PLUGIN_METADATA = {
4
4
  packageName: '@ankhorage/zora-game',
5
5
  displayName: 'ZORA Game',
6
6
  componentMeta: ZORA_GAME_COMPONENT_META,
7
- extensionHosts: ['Game', 'GameField', 'GameEntity', 'GameOverlay'],
7
+ extensionHosts: ['Game', 'GameEntity', 'GameField', 'GameInputZone', 'GameOverlay'],
8
8
  placements: [
9
9
  {
10
10
  child: 'Game',
@@ -18,6 +18,10 @@ export const ZORA_PLUGIN_METADATA = {
18
18
  child: 'GameEntity',
19
19
  parents: ['Game', 'GameField', 'GameOverlay'],
20
20
  },
21
+ {
22
+ child: 'GameInputZone',
23
+ parents: ['Game'],
24
+ },
21
25
  {
22
26
  child: 'GameOverlay',
23
27
  parents: ['Game', 'GameField'],
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_PLUGIN_METADATA.js","sourceRoot":"","sources":["../src/ZORA_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,wBAAwB;IACvC,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC;IAClE,UAAU,EAAE;QACV;YACE,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC;SAC9C;QACD;YACE,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;SAC/B;KACF;CACoC,CAAC","sourcesContent":["import type { ZoraPluginMetadata } from '@ankhorage/zora/metadata';\n\nimport { ZORA_GAME_COMPONENT_META } from './ZORA_GAME_COMPONENT_META';\n\n/*** Describe generic game presentation nodes and their valid ZORA extension hosts. */\nexport const ZORA_PLUGIN_METADATA = {\n packageName: '@ankhorage/zora-game',\n displayName: 'ZORA Game',\n componentMeta: ZORA_GAME_COMPONENT_META,\n extensionHosts: ['Game', 'GameField', 'GameEntity', 'GameOverlay'],\n placements: [\n {\n child: 'Game',\n parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],\n },\n {\n child: 'GameField',\n parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],\n },\n {\n child: 'GameEntity',\n parents: ['Game', 'GameField', 'GameOverlay'],\n },\n {\n child: 'GameOverlay',\n parents: ['Game', 'GameField'],\n },\n ],\n} as const satisfies ZoraPluginMetadata;\n"]}
1
+ {"version":3,"file":"ZORA_PLUGIN_METADATA.js","sourceRoot":"","sources":["../src/ZORA_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,wBAAwB;IACvC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,CAAC;IACnF,UAAU,EAAE;QACV;YACE,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC;SAC9C;QACD;YACE,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,CAAC,MAAM,CAAC;SAClB;QACD;YACE,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;SAC/B;KACF;CACoC,CAAC","sourcesContent":["import type { ZoraPluginMetadata } from '@ankhorage/zora/metadata';\n\nimport { ZORA_GAME_COMPONENT_META } from './ZORA_GAME_COMPONENT_META';\n\n/*** Describe generic game presentation nodes and their valid ZORA extension hosts. */\nexport const ZORA_PLUGIN_METADATA = {\n packageName: '@ankhorage/zora-game',\n displayName: 'ZORA Game',\n componentMeta: ZORA_GAME_COMPONENT_META,\n extensionHosts: ['Game', 'GameEntity', 'GameField', 'GameInputZone', 'GameOverlay'],\n placements: [\n {\n child: 'Game',\n parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],\n },\n {\n child: 'GameField',\n parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],\n },\n {\n child: 'GameEntity',\n parents: ['Game', 'GameField', 'GameOverlay'],\n },\n {\n child: 'GameInputZone',\n parents: ['Game'],\n },\n {\n child: 'GameOverlay',\n parents: ['Game', 'GameField'],\n },\n ],\n} as const satisfies ZoraPluginMetadata;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GameEntity.d.ts","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameEntity.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,CAAK,EACL,CAAK,EACL,KAAK,EACL,MAAM,EACN,OAAW,EACX,KAAS,EACT,QAAY,EACZ,MAAU,EACV,MAAc,EACd,aAAsB,EACtB,kBAAkB,EAClB,MAAM,GACP,EAAE,eAAe,+BAcjB"}
1
+ {"version":3,"file":"GameEntity.d.ts","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameEntity.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAG1E,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,CAAK,EACL,CAAK,EACL,KAAK,EACL,MAAM,EACN,OAAW,EACX,KAAS,EACT,QAAY,EACZ,MAAU,EACV,MAAc,EACd,aAAsB,EACtB,kBAAkB,EAClB,MAAM,GACP,EAAE,eAAe,+BAcjB"}
@@ -1,5 +1,6 @@
1
1
  import { View } from '@ankhorage/zora';
2
2
  import { StyleSheet } from 'react-native';
3
+ import { toGamePercentage } from '../../utils/toGamePercentage';
3
4
  /*** Render one generic positioned game entity without owning gameplay semantics. */
4
5
  export function GameEntity({ children, x = 0, y = 0, width, height, opacity = 1, scale = 1, rotation = 0, zIndex = 0, hidden = false, pointerEvents = 'auto', accessibilityLabel, testID, }) {
5
6
  return (<View {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })} {...(testID === undefined ? {} : { testID })} pointerEvents={pointerEvents} style={[
@@ -13,24 +14,16 @@ export function GameEntity({ children, x = 0, y = 0, width, height, opacity = 1,
13
14
  function createEntityStyle({ x, y, width, height, opacity, scale, rotation, zIndex, hidden, }) {
14
15
  return {
15
16
  display: hidden ? 'none' : 'flex',
16
- left: toPercent(x),
17
- opacity: clamp(opacity, 0, 1),
17
+ left: toGamePercentage(x),
18
+ opacity: Math.min(1, Math.max(0, opacity)),
18
19
  position: 'absolute',
19
- top: toPercent(y),
20
+ top: toGamePercentage(y),
20
21
  transform: [{ scale }, { rotate: `${rotation}deg` }],
21
22
  zIndex,
22
23
  ...(height === undefined ? {} : { height }),
23
24
  ...(width === undefined ? {} : { width }),
24
25
  };
25
26
  }
26
- /*** Convert a bounded percentage number to React Native percentage syntax. */
27
- function toPercent(value) {
28
- return `${clamp(value, 0, 100)}%`;
29
- }
30
- /*** Clamp one numeric presentation value to an inclusive range. */
31
- function clamp(value, minimum, maximum) {
32
- return Math.min(maximum, Math.max(minimum, value));
33
- }
34
27
  const styles = StyleSheet.create({
35
28
  root: {
36
29
  position: 'absolute',
@@ -1 +1 @@
1
- {"version":3,"file":"GameEntity.js","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAI1D,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,EACL,KAAK,EACL,MAAM,EACN,OAAO,GAAG,CAAC,EACX,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,CAAC,EACZ,MAAM,GAAG,CAAC,EACV,MAAM,GAAG,KAAK,EACd,aAAa,GAAG,MAAM,EACtB,kBAAkB,EAClB,MAAM,GACU;IAChB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,CACrE,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAC7C,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SACrF,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAcD,sFAAsF;AACtF,SAAS,iBAAiB,CAAC,EACzB,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,GACe;IACrB,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QACjC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC7B,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,QAAQ,KAAK,EAAE,CAAC;QACpD,MAAM;QACN,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;AACpC,CAAC;AAED,mEAAmE;AACnE,SAAS,KAAK,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe;IAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC","sourcesContent":["import { View } from '@ankhorage/zora';\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nimport type { GameEntityProps } from '../../../../types/gamePresentation';\n\n/*** Render one generic positioned game entity without owning gameplay semantics. */\nexport function GameEntity({\n children,\n x = 0,\n y = 0,\n width,\n height,\n opacity = 1,\n scale = 1,\n rotation = 0,\n zIndex = 0,\n hidden = false,\n pointerEvents = 'auto',\n accessibilityLabel,\n testID,\n}: GameEntityProps) {\n return (\n <View\n {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })}\n {...(testID === undefined ? {} : { testID })}\n pointerEvents={pointerEvents}\n style={[\n styles.root,\n createEntityStyle({ x, y, width, height, opacity, scale, rotation, zIndex, hidden }),\n ]}\n >\n {children}\n </View>\n );\n}\n\ninterface GameEntityStyleInput {\n readonly x: number;\n readonly y: number;\n readonly width: number | undefined;\n readonly height: number | undefined;\n readonly opacity: number;\n readonly scale: number;\n readonly rotation: number;\n readonly zIndex: number;\n readonly hidden: boolean;\n}\n\n/*** Convert serializable entity presentation props into a React Native view style. */\nfunction createEntityStyle({\n x,\n y,\n width,\n height,\n opacity,\n scale,\n rotation,\n zIndex,\n hidden,\n}: GameEntityStyleInput): ViewStyle {\n return {\n display: hidden ? 'none' : 'flex',\n left: toPercent(x),\n opacity: clamp(opacity, 0, 1),\n position: 'absolute',\n top: toPercent(y),\n transform: [{ scale }, { rotate: `${rotation}deg` }],\n zIndex,\n ...(height === undefined ? {} : { height }),\n ...(width === undefined ? {} : { width }),\n };\n}\n\n/*** Convert a bounded percentage number to React Native percentage syntax. */\nfunction toPercent(value: number): `${number}%` {\n return `${clamp(value, 0, 100)}%`;\n}\n\n/*** Clamp one numeric presentation value to an inclusive range. */\nfunction clamp(value: number, minimum: number, maximum: number): number {\n return Math.min(maximum, Math.max(minimum, value));\n}\n\nconst styles = StyleSheet.create({\n root: {\n position: 'absolute',\n },\n});\n"]}
1
+ {"version":3,"file":"GameEntity.js","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,EACL,KAAK,EACL,MAAM,EACN,OAAO,GAAG,CAAC,EACX,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,CAAC,EACZ,MAAM,GAAG,CAAC,EACV,MAAM,GAAG,KAAK,EACd,aAAa,GAAG,MAAM,EACtB,kBAAkB,EAClB,MAAM,GACU;IAChB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,CACrE,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAC7C,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SACrF,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAcD,sFAAsF;AACtF,SAAS,iBAAiB,CAAC,EACzB,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,GACe;IACrB,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QACjC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;QACzB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAC1C,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC;QACxB,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,QAAQ,KAAK,EAAE,CAAC;QACpD,MAAM;QACN,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC","sourcesContent":["import { View } from '@ankhorage/zora';\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nimport type { GameEntityProps } from '../../../../types/gamePresentation';\nimport { toGamePercentage } from '../../utils/toGamePercentage';\n\n/*** Render one generic positioned game entity without owning gameplay semantics. */\nexport function GameEntity({\n children,\n x = 0,\n y = 0,\n width,\n height,\n opacity = 1,\n scale = 1,\n rotation = 0,\n zIndex = 0,\n hidden = false,\n pointerEvents = 'auto',\n accessibilityLabel,\n testID,\n}: GameEntityProps) {\n return (\n <View\n {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })}\n {...(testID === undefined ? {} : { testID })}\n pointerEvents={pointerEvents}\n style={[\n styles.root,\n createEntityStyle({ x, y, width, height, opacity, scale, rotation, zIndex, hidden }),\n ]}\n >\n {children}\n </View>\n );\n}\n\ninterface GameEntityStyleInput {\n readonly x: number;\n readonly y: number;\n readonly width: number | undefined;\n readonly height: number | undefined;\n readonly opacity: number;\n readonly scale: number;\n readonly rotation: number;\n readonly zIndex: number;\n readonly hidden: boolean;\n}\n\n/*** Convert serializable entity presentation props into a React Native view style. */\nfunction createEntityStyle({\n x,\n y,\n width,\n height,\n opacity,\n scale,\n rotation,\n zIndex,\n hidden,\n}: GameEntityStyleInput): ViewStyle {\n return {\n display: hidden ? 'none' : 'flex',\n left: toGamePercentage(x),\n opacity: Math.min(1, Math.max(0, opacity)),\n position: 'absolute',\n top: toGamePercentage(y),\n transform: [{ scale }, { rotate: `${rotation}deg` }],\n zIndex,\n ...(height === undefined ? {} : { height }),\n ...(width === undefined ? {} : { width }),\n };\n}\n\nconst styles = StyleSheet.create({\n root: {\n position: 'absolute',\n },\n});\n"]}
@@ -0,0 +1,4 @@
1
+ import type { GameInputZoneProps } from '../../../../types/gamePresentation';
2
+ /*** Capture pointer/touch geometry and dispatch only normalized generic Game events. */
3
+ export declare function GameInputZone({ x, y, width, height, zIndex, enabled, continuous, accessibilityLabel, testID, ...inputProps }: GameInputZoneProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=GameInputZone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GameInputZone.d.ts","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameInputZone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,EAC5B,CAAK,EACL,CAAK,EACL,KAAW,EACX,MAAY,EACZ,MAAU,EACV,OAAc,EACd,UAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,GAAG,UAAU,EACd,EAAE,kBAAkB,+BAyBpB"}