@ankhorage/zora-game 0.1.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.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -1
- package/dist/ZORA_GAME_COMPONENT_META.d.ts +228 -0
- package/dist/ZORA_GAME_COMPONENT_META.d.ts.map +1 -1
- package/dist/ZORA_GAME_COMPONENT_META.js +4 -0
- package/dist/ZORA_GAME_COMPONENT_META.js.map +1 -1
- package/dist/ZORA_GAME_PLUGIN.d.ts +241 -3
- package/dist/ZORA_GAME_PLUGIN.d.ts.map +1 -1
- package/dist/ZORA_GAME_PLUGIN.js +4 -0
- package/dist/ZORA_GAME_PLUGIN.js.map +1 -1
- package/dist/ZORA_PLUGIN_METADATA.d.ts +237 -3
- package/dist/ZORA_PLUGIN_METADATA.d.ts.map +1 -1
- package/dist/ZORA_PLUGIN_METADATA.js +11 -3
- package/dist/ZORA_PLUGIN_METADATA.js.map +1 -1
- package/dist/features/game-presentation/adapters/inbound/Game.d.ts +5 -0
- package/dist/features/game-presentation/adapters/inbound/Game.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/Game.js +16 -0
- package/dist/features/game-presentation/adapters/inbound/Game.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameEntity.d.ts.map +1 -1
- package/dist/features/game-presentation/adapters/inbound/GameEntity.js +4 -11
- package/dist/features/game-presentation/adapters/inbound/GameEntity.js.map +1 -1
- package/dist/features/game-presentation/adapters/inbound/GameInputZone.d.ts +4 -0
- package/dist/features/game-presentation/adapters/inbound/GameInputZone.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameInputZone.js +35 -0
- package/dist/features/game-presentation/adapters/inbound/GameInputZone.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.d.ts +17 -0
- package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.js +20 -0
- package/dist/features/game-presentation/adapters/inbound/createGamePointerEvent.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.d.ts +9 -0
- package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.js +37 -0
- package/dist/features/game-presentation/adapters/inbound/useGameInputZoneResponder.js.map +1 -0
- package/dist/features/game-presentation/composition/GameRuntimeContext.d.ts +5 -0
- package/dist/features/game-presentation/composition/GameRuntimeContext.d.ts.map +1 -0
- package/dist/features/game-presentation/composition/GameRuntimeContext.js +4 -0
- package/dist/features/game-presentation/composition/GameRuntimeContext.js.map +1 -0
- package/dist/features/game-presentation/composition/useGameRuntime.d.ts +5 -0
- package/dist/features/game-presentation/composition/useGameRuntime.d.ts.map +1 -0
- package/dist/features/game-presentation/composition/useGameRuntime.js +103 -0
- package/dist/features/game-presentation/composition/useGameRuntime.js.map +1 -0
- package/dist/features/game-presentation/composition/useGameScheduledEffects.d.ts +17 -0
- package/dist/features/game-presentation/composition/useGameScheduledEffects.d.ts.map +1 -0
- package/dist/features/game-presentation/composition/useGameScheduledEffects.js +40 -0
- package/dist/features/game-presentation/composition/useGameScheduledEffects.js.map +1 -0
- package/dist/features/game-presentation/meta/gameInputZoneMeta.d.ts +112 -0
- package/dist/features/game-presentation/meta/gameInputZoneMeta.d.ts.map +1 -0
- package/dist/features/game-presentation/meta/gameInputZoneMeta.js +92 -0
- package/dist/features/game-presentation/meta/gameInputZoneMeta.js.map +1 -0
- package/dist/features/game-presentation/meta/gameMeta.d.ts +120 -0
- package/dist/features/game-presentation/meta/gameMeta.d.ts.map +1 -0
- package/dist/features/game-presentation/meta/gameMeta.js +97 -0
- package/dist/features/game-presentation/meta/gameMeta.js.map +1 -0
- package/dist/features/game-presentation/public.d.ts +3 -1
- package/dist/features/game-presentation/public.d.ts.map +1 -1
- package/dist/features/game-presentation/public.js +2 -0
- package/dist/features/game-presentation/public.js.map +1 -1
- package/dist/features/game-presentation/utils/clampGamePercentage.d.ts +3 -0
- package/dist/features/game-presentation/utils/clampGamePercentage.d.ts.map +1 -0
- package/dist/features/game-presentation/utils/clampGamePercentage.js +5 -0
- package/dist/features/game-presentation/utils/clampGamePercentage.js.map +1 -0
- package/dist/features/game-presentation/utils/toGamePercentage.d.ts +3 -0
- package/dist/features/game-presentation/utils/toGamePercentage.d.ts.map +1 -0
- package/dist/features/game-presentation/utils/toGamePercentage.js +6 -0
- package/dist/features/game-presentation/utils/toGamePercentage.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/gamePresentation.d.ts +22 -0
- package/dist/types/gamePresentation.d.ts.map +1 -1
- package/dist/types/gamePresentation.js.map +1 -1
- package/dist/types/gameRuntime.d.ts +12 -0
- package/dist/types/gameRuntime.d.ts.map +1 -0
- package/dist/types/gameRuntime.js +2 -0
- package/dist/types/gameRuntime.js.map +1 -0
- package/package.json +5 -2
- package/src/ZORA_GAME_COMPONENT_META.ts +4 -0
- package/src/ZORA_GAME_PLUGIN.ts +4 -0
- package/src/ZORA_PLUGIN_METADATA.test.ts +39 -5
- package/src/ZORA_PLUGIN_METADATA.ts +11 -3
- package/src/features/game-presentation/adapters/inbound/Game.tsx +27 -0
- package/src/features/game-presentation/adapters/inbound/GameEntity.tsx +4 -13
- package/src/features/game-presentation/adapters/inbound/GameInputZone.tsx +70 -0
- package/src/features/game-presentation/adapters/inbound/createGamePointerEvent.test.ts +56 -0
- package/src/features/game-presentation/adapters/inbound/createGamePointerEvent.ts +39 -0
- package/src/features/game-presentation/adapters/inbound/useGameInputZoneResponder.ts +49 -0
- package/src/features/game-presentation/composition/GameRuntimeContext.ts +6 -0
- package/src/features/game-presentation/composition/useGameRuntime.ts +181 -0
- package/src/features/game-presentation/composition/useGameScheduledEffects.ts +85 -0
- package/src/features/game-presentation/meta/gameInputZoneMeta.ts +94 -0
- package/src/features/game-presentation/meta/gameMeta.ts +99 -0
- package/src/features/game-presentation/public.ts +4 -0
- package/src/features/game-presentation/utils/clampGamePercentage.ts +4 -0
- package/src/features/game-presentation/utils/toGamePercentage.ts +6 -0
- package/src/index.ts +9 -1
- package/src/types/gamePresentation.ts +24 -0
- package/src/types/gameRuntime.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
10
|
+
## 0.2.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- f9e964f: Add the embeddable `Game` binder backed by the published `@ankhorage/game` runtime, local session
|
|
15
|
+
state, scheduled-effect timing, ordinary ZORA placement metadata, and app-bindable game outputs.
|
|
16
|
+
|
|
3
17
|
## 0.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/zora-game
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Generic game presentation primitives for React Native and React Native Web apps built on ZORA.
|
|
9
9
|
|
|
@@ -15,5 +15,7 @@ Generic game presentation primitives for React Native and React Native Web apps
|
|
|
15
15
|
- [Architecture overview](././paradox/diagrams/architecture-overview.mmd)
|
|
16
16
|
- [Module relationships](././paradox/diagrams/module-relationships.mmd)
|
|
17
17
|
- [Export graph](././paradox/diagrams/export-graph.mmd)
|
|
18
|
+
- [Game sequence](././paradox/diagrams/sequences/game.mmd)
|
|
18
19
|
- [GameEntity sequence](././paradox/diagrams/sequences/game-entity.mmd)
|
|
20
|
+
- [GameInputZone sequence](././paradox/diagrams/sequences/game-input-zone.mmd)
|
|
19
21
|
- [GameOverlay sequence](././paradox/diagrams/sequences/game-overlay.mmd)
|
|
@@ -1,5 +1,123 @@
|
|
|
1
1
|
/*** Register the generic game presentation metadata owned by this package. */
|
|
2
2
|
export declare const ZORA_GAME_COMPONENT_META: {
|
|
3
|
+
readonly Game: {
|
|
4
|
+
readonly name: "Game";
|
|
5
|
+
readonly category: "pattern";
|
|
6
|
+
readonly description: "Embeds one config-driven game session inside ordinary ZORA layout and emits domain-neutral game outputs.";
|
|
7
|
+
readonly directManifestNode: true;
|
|
8
|
+
readonly allowedChildren: readonly ["GameEntity", "GameInputZone", "GameOverlay", "Gradient", "Image", "View"];
|
|
9
|
+
readonly blueprint: {
|
|
10
|
+
readonly label: "Game";
|
|
11
|
+
readonly defaultProps: {
|
|
12
|
+
readonly definition: {
|
|
13
|
+
readonly id: "game";
|
|
14
|
+
readonly initialPhase: "playing";
|
|
15
|
+
readonly stages: readonly [{
|
|
16
|
+
readonly id: "main";
|
|
17
|
+
}];
|
|
18
|
+
readonly rules: readonly [];
|
|
19
|
+
};
|
|
20
|
+
readonly seed: 0;
|
|
21
|
+
readonly resetKey: "";
|
|
22
|
+
readonly autoAdvanceTime: true;
|
|
23
|
+
readonly minHeight: 320;
|
|
24
|
+
readonly clip: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly bindings: {
|
|
28
|
+
readonly props: {
|
|
29
|
+
readonly definition: {
|
|
30
|
+
readonly value: {
|
|
31
|
+
readonly type: "object";
|
|
32
|
+
};
|
|
33
|
+
readonly acceptsFallback: true;
|
|
34
|
+
};
|
|
35
|
+
readonly input: {
|
|
36
|
+
readonly value: {
|
|
37
|
+
readonly type: "record";
|
|
38
|
+
};
|
|
39
|
+
readonly acceptsFallback: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly events: {
|
|
44
|
+
readonly output: {
|
|
45
|
+
readonly label: "Game output";
|
|
46
|
+
readonly eventType: "game.output";
|
|
47
|
+
readonly description: "Emitted when the platform-neutral game runtime produces an app/domain output.";
|
|
48
|
+
readonly payloadFields: readonly [{
|
|
49
|
+
readonly path: "type";
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
}, {
|
|
52
|
+
readonly path: "payload";
|
|
53
|
+
readonly type: "record";
|
|
54
|
+
}];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly props: {
|
|
58
|
+
readonly seed: {
|
|
59
|
+
readonly type: "number";
|
|
60
|
+
readonly category: "Runtime";
|
|
61
|
+
readonly label: "Initial seed";
|
|
62
|
+
readonly default: 0;
|
|
63
|
+
readonly authoring: {
|
|
64
|
+
readonly authority: "instance";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly resetKey: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly category: "Runtime";
|
|
70
|
+
readonly label: "Reset key";
|
|
71
|
+
readonly default: "";
|
|
72
|
+
readonly authoring: {
|
|
73
|
+
readonly authority: "instance";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly autoAdvanceTime: {
|
|
77
|
+
readonly type: "boolean";
|
|
78
|
+
readonly category: "Runtime";
|
|
79
|
+
readonly label: "Advance scheduled effects";
|
|
80
|
+
readonly default: true;
|
|
81
|
+
readonly authoring: {
|
|
82
|
+
readonly authority: "instance";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
readonly aspectRatio: {
|
|
86
|
+
readonly type: "number";
|
|
87
|
+
readonly category: "Layout";
|
|
88
|
+
readonly label: "Aspect ratio";
|
|
89
|
+
readonly authoring: {
|
|
90
|
+
readonly authority: "instance";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly minHeight: {
|
|
94
|
+
readonly type: "number";
|
|
95
|
+
readonly category: "Layout";
|
|
96
|
+
readonly label: "Minimum height";
|
|
97
|
+
readonly default: 320;
|
|
98
|
+
readonly authoring: {
|
|
99
|
+
readonly authority: "instance";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly clip: {
|
|
103
|
+
readonly type: "boolean";
|
|
104
|
+
readonly category: "Layout";
|
|
105
|
+
readonly label: "Clip overflow";
|
|
106
|
+
readonly default: true;
|
|
107
|
+
readonly authoring: {
|
|
108
|
+
readonly authority: "instance";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly accessibilityLabel: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
readonly category: "Accessibility";
|
|
114
|
+
readonly label: "Accessibility label";
|
|
115
|
+
readonly authoring: {
|
|
116
|
+
readonly authority: "instance";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
3
121
|
readonly GameEntity: {
|
|
4
122
|
readonly name: "GameEntity";
|
|
5
123
|
readonly category: "component";
|
|
@@ -167,6 +285,116 @@ export declare const ZORA_GAME_COMPONENT_META: {
|
|
|
167
285
|
};
|
|
168
286
|
};
|
|
169
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
|
+
};
|
|
170
398
|
readonly GameOverlay: {
|
|
171
399
|
readonly name: "GameOverlay";
|
|
172
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":"
|
|
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,10 +1,14 @@
|
|
|
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';
|
|
4
|
+
import { gameMeta } from './features/game-presentation/meta/gameMeta';
|
|
3
5
|
import { gameOverlayMeta } from './features/game-presentation/meta/gameOverlayMeta';
|
|
4
6
|
/*** Register the generic game presentation metadata owned by this package. */
|
|
5
7
|
export const ZORA_GAME_COMPONENT_META = {
|
|
8
|
+
Game: gameMeta,
|
|
6
9
|
GameEntity: gameEntityMeta,
|
|
7
10
|
GameField: gameFieldMeta,
|
|
11
|
+
GameInputZone: gameInputZoneMeta,
|
|
8
12
|
GameOverlay: gameOverlayMeta,
|
|
9
13
|
};
|
|
10
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,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,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 { 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 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,16 +1,138 @@
|
|
|
1
|
+
import { Game } from './features/game-presentation/adapters/inbound/Game';
|
|
1
2
|
import { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';
|
|
2
3
|
import { GameField } from './features/game-presentation/adapters/inbound/GameField';
|
|
4
|
+
import { GameInputZone } from './features/game-presentation/adapters/inbound/GameInputZone';
|
|
3
5
|
import { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';
|
|
4
6
|
/*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */
|
|
5
7
|
export declare const ZORA_GAME_PLUGIN: {
|
|
6
8
|
readonly componentRegistry: {
|
|
9
|
+
readonly Game: typeof Game;
|
|
7
10
|
readonly GameEntity: typeof GameEntity;
|
|
8
11
|
readonly GameField: typeof GameField;
|
|
12
|
+
readonly GameInputZone: typeof GameInputZone;
|
|
9
13
|
readonly GameOverlay: typeof GameOverlay;
|
|
10
14
|
};
|
|
11
15
|
readonly packageName: "@ankhorage/zora-game";
|
|
12
16
|
readonly displayName: "ZORA Game";
|
|
13
17
|
readonly componentMeta: {
|
|
18
|
+
readonly Game: {
|
|
19
|
+
readonly name: "Game";
|
|
20
|
+
readonly category: "pattern";
|
|
21
|
+
readonly description: "Embeds one config-driven game session inside ordinary ZORA layout and emits domain-neutral game outputs.";
|
|
22
|
+
readonly directManifestNode: true;
|
|
23
|
+
readonly allowedChildren: readonly ["GameEntity", "GameInputZone", "GameOverlay", "Gradient", "Image", "View"];
|
|
24
|
+
readonly blueprint: {
|
|
25
|
+
readonly label: "Game";
|
|
26
|
+
readonly defaultProps: {
|
|
27
|
+
readonly definition: {
|
|
28
|
+
readonly id: "game";
|
|
29
|
+
readonly initialPhase: "playing";
|
|
30
|
+
readonly stages: readonly [{
|
|
31
|
+
readonly id: "main";
|
|
32
|
+
}];
|
|
33
|
+
readonly rules: readonly [];
|
|
34
|
+
};
|
|
35
|
+
readonly seed: 0;
|
|
36
|
+
readonly resetKey: "";
|
|
37
|
+
readonly autoAdvanceTime: true;
|
|
38
|
+
readonly minHeight: 320;
|
|
39
|
+
readonly clip: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly bindings: {
|
|
43
|
+
readonly props: {
|
|
44
|
+
readonly definition: {
|
|
45
|
+
readonly value: {
|
|
46
|
+
readonly type: "object";
|
|
47
|
+
};
|
|
48
|
+
readonly acceptsFallback: true;
|
|
49
|
+
};
|
|
50
|
+
readonly input: {
|
|
51
|
+
readonly value: {
|
|
52
|
+
readonly type: "record";
|
|
53
|
+
};
|
|
54
|
+
readonly acceptsFallback: true;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly events: {
|
|
59
|
+
readonly output: {
|
|
60
|
+
readonly label: "Game output";
|
|
61
|
+
readonly eventType: "game.output";
|
|
62
|
+
readonly description: "Emitted when the platform-neutral game runtime produces an app/domain output.";
|
|
63
|
+
readonly payloadFields: readonly [{
|
|
64
|
+
readonly path: "type";
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
}, {
|
|
67
|
+
readonly path: "payload";
|
|
68
|
+
readonly type: "record";
|
|
69
|
+
}];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly props: {
|
|
73
|
+
readonly seed: {
|
|
74
|
+
readonly type: "number";
|
|
75
|
+
readonly category: "Runtime";
|
|
76
|
+
readonly label: "Initial seed";
|
|
77
|
+
readonly default: 0;
|
|
78
|
+
readonly authoring: {
|
|
79
|
+
readonly authority: "instance";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly resetKey: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly category: "Runtime";
|
|
85
|
+
readonly label: "Reset key";
|
|
86
|
+
readonly default: "";
|
|
87
|
+
readonly authoring: {
|
|
88
|
+
readonly authority: "instance";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly autoAdvanceTime: {
|
|
92
|
+
readonly type: "boolean";
|
|
93
|
+
readonly category: "Runtime";
|
|
94
|
+
readonly label: "Advance scheduled effects";
|
|
95
|
+
readonly default: true;
|
|
96
|
+
readonly authoring: {
|
|
97
|
+
readonly authority: "instance";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly aspectRatio: {
|
|
101
|
+
readonly type: "number";
|
|
102
|
+
readonly category: "Layout";
|
|
103
|
+
readonly label: "Aspect ratio";
|
|
104
|
+
readonly authoring: {
|
|
105
|
+
readonly authority: "instance";
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly minHeight: {
|
|
109
|
+
readonly type: "number";
|
|
110
|
+
readonly category: "Layout";
|
|
111
|
+
readonly label: "Minimum height";
|
|
112
|
+
readonly default: 320;
|
|
113
|
+
readonly authoring: {
|
|
114
|
+
readonly authority: "instance";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly clip: {
|
|
118
|
+
readonly type: "boolean";
|
|
119
|
+
readonly category: "Layout";
|
|
120
|
+
readonly label: "Clip overflow";
|
|
121
|
+
readonly default: true;
|
|
122
|
+
readonly authoring: {
|
|
123
|
+
readonly authority: "instance";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly accessibilityLabel: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly category: "Accessibility";
|
|
129
|
+
readonly label: "Accessibility label";
|
|
130
|
+
readonly authoring: {
|
|
131
|
+
readonly authority: "instance";
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
14
136
|
readonly GameEntity: {
|
|
15
137
|
readonly name: "GameEntity";
|
|
16
138
|
readonly category: "component";
|
|
@@ -178,6 +300,116 @@ export declare const ZORA_GAME_PLUGIN: {
|
|
|
178
300
|
};
|
|
179
301
|
};
|
|
180
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
|
+
};
|
|
181
413
|
readonly GameOverlay: {
|
|
182
414
|
readonly name: "GameOverlay";
|
|
183
415
|
readonly category: "layout";
|
|
@@ -232,16 +464,22 @@ export declare const ZORA_GAME_PLUGIN: {
|
|
|
232
464
|
};
|
|
233
465
|
};
|
|
234
466
|
};
|
|
235
|
-
readonly extensionHosts: readonly ["
|
|
467
|
+
readonly extensionHosts: readonly ["Game", "GameEntity", "GameField", "GameInputZone", "GameOverlay"];
|
|
236
468
|
readonly placements: readonly [{
|
|
469
|
+
readonly child: "Game";
|
|
470
|
+
readonly parents: readonly ["Card", "Grid", "Screen", "ScreenSection", "View"];
|
|
471
|
+
}, {
|
|
237
472
|
readonly child: "GameField";
|
|
238
473
|
readonly parents: readonly ["Card", "Grid", "Screen", "ScreenSection", "View"];
|
|
239
474
|
}, {
|
|
240
475
|
readonly child: "GameEntity";
|
|
241
|
-
readonly parents: readonly ["GameField", "GameOverlay"];
|
|
476
|
+
readonly parents: readonly ["Game", "GameField", "GameOverlay"];
|
|
477
|
+
}, {
|
|
478
|
+
readonly child: "GameInputZone";
|
|
479
|
+
readonly parents: readonly ["Game"];
|
|
242
480
|
}, {
|
|
243
481
|
readonly child: "GameOverlay";
|
|
244
|
-
readonly parents: readonly ["GameField"];
|
|
482
|
+
readonly parents: readonly ["Game", "GameField"];
|
|
245
483
|
}];
|
|
246
484
|
};
|
|
247
485
|
//# sourceMappingURL=ZORA_GAME_PLUGIN.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_GAME_PLUGIN.d.ts","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,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
|
|
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"}
|
package/dist/ZORA_GAME_PLUGIN.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { Game } from './features/game-presentation/adapters/inbound/Game';
|
|
1
2
|
import { GameEntity } from './features/game-presentation/adapters/inbound/GameEntity';
|
|
2
3
|
import { GameField } from './features/game-presentation/adapters/inbound/GameField';
|
|
4
|
+
import { GameInputZone } from './features/game-presentation/adapters/inbound/GameInputZone';
|
|
3
5
|
import { GameOverlay } from './features/game-presentation/adapters/inbound/GameOverlay';
|
|
4
6
|
import { ZORA_PLUGIN_METADATA } from './ZORA_PLUGIN_METADATA';
|
|
5
7
|
/*** Expose the runtime component registry together with metadata for ZORA plugin consumers. */
|
|
6
8
|
export const ZORA_GAME_PLUGIN = {
|
|
7
9
|
...ZORA_PLUGIN_METADATA,
|
|
8
10
|
componentRegistry: {
|
|
11
|
+
Game,
|
|
9
12
|
GameEntity,
|
|
10
13
|
GameField,
|
|
14
|
+
GameInputZone,
|
|
11
15
|
GameOverlay,
|
|
12
16
|
},
|
|
13
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_GAME_PLUGIN.js","sourceRoot":"","sources":["../src/ZORA_GAME_PLUGIN.ts"],"names":[],"mappings":"AAAA,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,UAAU;QACV,SAAS;QACT,WAAW;KACZ;CACO,CAAC","sourcesContent":["import { 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 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"]}
|