@ankhorage/zora-game 0.1.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 +11 -0
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/ZORA_GAME_COMPONENT_META.d.ts +224 -0
- package/dist/ZORA_GAME_COMPONENT_META.d.ts.map +1 -0
- package/dist/ZORA_GAME_COMPONENT_META.js +10 -0
- package/dist/ZORA_GAME_COMPONENT_META.js.map +1 -0
- package/dist/ZORA_GAME_PLUGIN.d.ts +247 -0
- package/dist/ZORA_GAME_PLUGIN.d.ts.map +1 -0
- package/dist/ZORA_GAME_PLUGIN.js +14 -0
- package/dist/ZORA_GAME_PLUGIN.js.map +1 -0
- package/dist/ZORA_PLUGIN_METADATA.d.ts +239 -0
- package/dist/ZORA_PLUGIN_METADATA.d.ts.map +1 -0
- package/dist/ZORA_PLUGIN_METADATA.js +23 -0
- package/dist/ZORA_PLUGIN_METADATA.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameEntity.d.ts +4 -0
- package/dist/features/game-presentation/adapters/inbound/GameEntity.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameEntity.js +39 -0
- package/dist/features/game-presentation/adapters/inbound/GameEntity.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameField.d.ts +4 -0
- package/dist/features/game-presentation/adapters/inbound/GameField.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameField.js +28 -0
- package/dist/features/game-presentation/adapters/inbound/GameField.js.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameOverlay.d.ts +4 -0
- package/dist/features/game-presentation/adapters/inbound/GameOverlay.d.ts.map +1 -0
- package/dist/features/game-presentation/adapters/inbound/GameOverlay.js +39 -0
- package/dist/features/game-presentation/adapters/inbound/GameOverlay.js.map +1 -0
- package/dist/features/game-presentation/meta/gameEntityMeta.d.ts +119 -0
- package/dist/features/game-presentation/meta/gameEntityMeta.d.ts.map +1 -0
- package/dist/features/game-presentation/meta/gameEntityMeta.js +90 -0
- package/dist/features/game-presentation/meta/gameEntityMeta.js.map +1 -0
- package/dist/features/game-presentation/meta/gameFieldMeta.d.ts +52 -0
- package/dist/features/game-presentation/meta/gameFieldMeta.d.ts.map +1 -0
- package/dist/features/game-presentation/meta/gameFieldMeta.js +41 -0
- package/dist/features/game-presentation/meta/gameFieldMeta.js.map +1 -0
- package/dist/features/game-presentation/meta/gameOverlayMeta.d.ts +55 -0
- package/dist/features/game-presentation/meta/gameOverlayMeta.d.ts.map +1 -0
- package/dist/features/game-presentation/meta/gameOverlayMeta.js +65 -0
- package/dist/features/game-presentation/meta/gameOverlayMeta.js.map +1 -0
- package/dist/features/game-presentation/public.d.ts +5 -0
- package/dist/features/game-presentation/public.d.ts.map +1 -0
- package/dist/features/game-presentation/public.js +4 -0
- package/dist/features/game-presentation/public.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata.d.ts +3 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +3 -0
- package/dist/metadata.js.map +1 -0
- package/dist/types/gamePresentation.d.ts +37 -0
- package/dist/types/gamePresentation.d.ts.map +1 -0
- package/dist/types/gamePresentation.js +2 -0
- package/dist/types/gamePresentation.js.map +1 -0
- package/package.json +95 -0
- package/src/ZORA_GAME_COMPONENT_META.ts +10 -0
- package/src/ZORA_GAME_PLUGIN.ts +14 -0
- package/src/ZORA_PLUGIN_METADATA.test.ts +24 -0
- package/src/ZORA_PLUGIN_METADATA.ts +25 -0
- package/src/features/game-presentation/adapters/inbound/GameEntity.tsx +88 -0
- package/src/features/game-presentation/adapters/inbound/GameField.tsx +44 -0
- package/src/features/game-presentation/adapters/inbound/GameOverlay.tsx +57 -0
- package/src/features/game-presentation/meta/gameEntityMeta.ts +91 -0
- package/src/features/game-presentation/meta/gameFieldMeta.ts +42 -0
- package/src/features/game-presentation/meta/gameOverlayMeta.ts +66 -0
- package/src/features/game-presentation/public.ts +10 -0
- package/src/index.ts +9 -0
- package/src/metadata.ts +2 -0
- package/src/types/gamePresentation.ts +41 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/*** Describe generic game presentation nodes and their valid ZORA extension hosts. */
|
|
2
|
+
export declare const ZORA_PLUGIN_METADATA: {
|
|
3
|
+
readonly packageName: "@ankhorage/zora-game";
|
|
4
|
+
readonly displayName: "ZORA Game";
|
|
5
|
+
readonly componentMeta: {
|
|
6
|
+
readonly GameEntity: {
|
|
7
|
+
readonly name: "GameEntity";
|
|
8
|
+
readonly category: "component";
|
|
9
|
+
readonly description: "Positions arbitrary visual content inside a GameField without owning game rules.";
|
|
10
|
+
readonly directManifestNode: true;
|
|
11
|
+
readonly allowedChildren: readonly ["Badge", "Icon", "Image", "Text", "View"];
|
|
12
|
+
readonly blueprint: {
|
|
13
|
+
readonly label: "Game entity";
|
|
14
|
+
readonly defaultProps: {
|
|
15
|
+
readonly x: 0;
|
|
16
|
+
readonly y: 0;
|
|
17
|
+
readonly opacity: 1;
|
|
18
|
+
readonly scale: 1;
|
|
19
|
+
readonly rotation: 0;
|
|
20
|
+
readonly zIndex: 0;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly props: {
|
|
24
|
+
readonly x: {
|
|
25
|
+
readonly type: "number";
|
|
26
|
+
readonly category: "Position";
|
|
27
|
+
readonly label: "X (%)";
|
|
28
|
+
readonly default: 0;
|
|
29
|
+
readonly authoring: {
|
|
30
|
+
readonly authority: "instance";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly y: {
|
|
34
|
+
readonly type: "number";
|
|
35
|
+
readonly category: "Position";
|
|
36
|
+
readonly label: "Y (%)";
|
|
37
|
+
readonly default: 0;
|
|
38
|
+
readonly authoring: {
|
|
39
|
+
readonly authority: "instance";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly width: {
|
|
43
|
+
readonly type: "number";
|
|
44
|
+
readonly category: "Size";
|
|
45
|
+
readonly label: "Width";
|
|
46
|
+
readonly authoring: {
|
|
47
|
+
readonly authority: "instance";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly height: {
|
|
51
|
+
readonly type: "number";
|
|
52
|
+
readonly category: "Size";
|
|
53
|
+
readonly label: "Height";
|
|
54
|
+
readonly authoring: {
|
|
55
|
+
readonly authority: "instance";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly opacity: {
|
|
59
|
+
readonly type: "number";
|
|
60
|
+
readonly category: "Appearance";
|
|
61
|
+
readonly label: "Opacity";
|
|
62
|
+
readonly default: 1;
|
|
63
|
+
readonly authoring: {
|
|
64
|
+
readonly authority: "instance";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly scale: {
|
|
68
|
+
readonly type: "number";
|
|
69
|
+
readonly category: "Transform";
|
|
70
|
+
readonly label: "Scale";
|
|
71
|
+
readonly default: 1;
|
|
72
|
+
readonly authoring: {
|
|
73
|
+
readonly authority: "instance";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly rotation: {
|
|
77
|
+
readonly type: "number";
|
|
78
|
+
readonly category: "Transform";
|
|
79
|
+
readonly label: "Rotation";
|
|
80
|
+
readonly default: 0;
|
|
81
|
+
readonly authoring: {
|
|
82
|
+
readonly authority: "instance";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
readonly zIndex: {
|
|
86
|
+
readonly type: "number";
|
|
87
|
+
readonly category: "Position";
|
|
88
|
+
readonly label: "Z index";
|
|
89
|
+
readonly default: 0;
|
|
90
|
+
readonly authoring: {
|
|
91
|
+
readonly authority: "instance";
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
readonly hidden: {
|
|
95
|
+
readonly type: "boolean";
|
|
96
|
+
readonly category: "State";
|
|
97
|
+
readonly label: "Hidden";
|
|
98
|
+
readonly default: false;
|
|
99
|
+
readonly authoring: {
|
|
100
|
+
readonly authority: "instance";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
readonly pointerEvents: {
|
|
104
|
+
readonly type: "enum";
|
|
105
|
+
readonly category: "Interaction";
|
|
106
|
+
readonly label: "Pointer events";
|
|
107
|
+
readonly enum: readonly ["auto", "box-none", "box-only", "none"];
|
|
108
|
+
readonly default: "auto";
|
|
109
|
+
readonly authoring: {
|
|
110
|
+
readonly authority: "instance";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly accessibilityLabel: {
|
|
114
|
+
readonly type: "string";
|
|
115
|
+
readonly category: "Accessibility";
|
|
116
|
+
readonly label: "Accessibility label";
|
|
117
|
+
readonly authoring: {
|
|
118
|
+
readonly authority: "instance";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly GameField: {
|
|
124
|
+
readonly name: "GameField";
|
|
125
|
+
readonly category: "layout";
|
|
126
|
+
readonly description: "Relative positioning surface for embeddable game presentation content.";
|
|
127
|
+
readonly directManifestNode: true;
|
|
128
|
+
readonly allowedChildren: readonly ["GameEntity", "GameOverlay", "Gradient", "Image", "View"];
|
|
129
|
+
readonly blueprint: {
|
|
130
|
+
readonly label: "Game field";
|
|
131
|
+
readonly defaultProps: {
|
|
132
|
+
readonly minHeight: 320;
|
|
133
|
+
readonly clip: true;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly props: {
|
|
137
|
+
readonly aspectRatio: {
|
|
138
|
+
readonly type: "number";
|
|
139
|
+
readonly category: "Layout";
|
|
140
|
+
readonly label: "Aspect ratio";
|
|
141
|
+
readonly authoring: {
|
|
142
|
+
readonly authority: "instance";
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly minHeight: {
|
|
146
|
+
readonly type: "number";
|
|
147
|
+
readonly category: "Layout";
|
|
148
|
+
readonly label: "Minimum height";
|
|
149
|
+
readonly default: 320;
|
|
150
|
+
readonly authoring: {
|
|
151
|
+
readonly authority: "instance";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly clip: {
|
|
155
|
+
readonly type: "boolean";
|
|
156
|
+
readonly category: "Layout";
|
|
157
|
+
readonly label: "Clip overflow";
|
|
158
|
+
readonly default: true;
|
|
159
|
+
readonly authoring: {
|
|
160
|
+
readonly authority: "instance";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly accessibilityLabel: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly category: "Accessibility";
|
|
166
|
+
readonly label: "Accessibility label";
|
|
167
|
+
readonly authoring: {
|
|
168
|
+
readonly authority: "instance";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly GameOverlay: {
|
|
174
|
+
readonly name: "GameOverlay";
|
|
175
|
+
readonly category: "layout";
|
|
176
|
+
readonly description: "Absolute presentation layer for HUD, feedback, controls, and phase content.";
|
|
177
|
+
readonly directManifestNode: true;
|
|
178
|
+
readonly allowedChildren: readonly ["Badge", "Button", "ButtonGroup", "Card", "GameEntity", "Heading", "Icon", "Image", "Progress", "ProgressRing", "Text", "View"];
|
|
179
|
+
readonly blueprint: {
|
|
180
|
+
readonly label: "Game overlay";
|
|
181
|
+
readonly defaultProps: {
|
|
182
|
+
readonly placement: "fill";
|
|
183
|
+
readonly blocking: false;
|
|
184
|
+
readonly padding: 0;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly props: {
|
|
188
|
+
readonly placement: {
|
|
189
|
+
readonly type: "enum";
|
|
190
|
+
readonly category: "Layout";
|
|
191
|
+
readonly label: "Placement";
|
|
192
|
+
readonly enum: readonly ["fill", "center", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"];
|
|
193
|
+
readonly default: "fill";
|
|
194
|
+
readonly authoring: {
|
|
195
|
+
readonly authority: "instance";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
readonly blocking: {
|
|
199
|
+
readonly type: "boolean";
|
|
200
|
+
readonly category: "Interaction";
|
|
201
|
+
readonly label: "Block pointer input";
|
|
202
|
+
readonly default: false;
|
|
203
|
+
readonly authoring: {
|
|
204
|
+
readonly authority: "instance";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
readonly padding: {
|
|
208
|
+
readonly type: "number";
|
|
209
|
+
readonly category: "Layout";
|
|
210
|
+
readonly label: "Padding";
|
|
211
|
+
readonly default: 0;
|
|
212
|
+
readonly authoring: {
|
|
213
|
+
readonly authority: "instance";
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
readonly accessibilityLabel: {
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
readonly category: "Accessibility";
|
|
219
|
+
readonly label: "Accessibility label";
|
|
220
|
+
readonly authoring: {
|
|
221
|
+
readonly authority: "instance";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
readonly extensionHosts: readonly ["GameField", "GameEntity", "GameOverlay"];
|
|
228
|
+
readonly placements: readonly [{
|
|
229
|
+
readonly child: "GameField";
|
|
230
|
+
readonly parents: readonly ["Card", "Grid", "Screen", "ScreenSection", "View"];
|
|
231
|
+
}, {
|
|
232
|
+
readonly child: "GameEntity";
|
|
233
|
+
readonly parents: readonly ["GameField", "GameOverlay"];
|
|
234
|
+
}, {
|
|
235
|
+
readonly child: "GameOverlay";
|
|
236
|
+
readonly parents: readonly ["GameField"];
|
|
237
|
+
}];
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=ZORA_PLUGIN_METADATA.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBM,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZORA_GAME_COMPONENT_META } from './ZORA_GAME_COMPONENT_META';
|
|
2
|
+
/*** Describe generic game presentation nodes and their valid ZORA extension hosts. */
|
|
3
|
+
export const ZORA_PLUGIN_METADATA = {
|
|
4
|
+
packageName: '@ankhorage/zora-game',
|
|
5
|
+
displayName: 'ZORA Game',
|
|
6
|
+
componentMeta: ZORA_GAME_COMPONENT_META,
|
|
7
|
+
extensionHosts: ['GameField', 'GameEntity', 'GameOverlay'],
|
|
8
|
+
placements: [
|
|
9
|
+
{
|
|
10
|
+
child: 'GameField',
|
|
11
|
+
parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
child: 'GameEntity',
|
|
15
|
+
parents: ['GameField', 'GameOverlay'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
child: 'GameOverlay',
|
|
19
|
+
parents: ['GameField'],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ZORA_PLUGIN_METADATA.js.map
|
|
@@ -0,0 +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,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC;IAC1D,UAAU,EAAE;QACV;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,WAAW,EAAE,aAAa,CAAC;SACtC;QACD;YACE,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,CAAC,WAAW,CAAC;SACvB;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: ['GameField', 'GameEntity', 'GameOverlay'],\n placements: [\n {\n child: 'GameField',\n parents: ['Card', 'Grid', 'Screen', 'ScreenSection', 'View'],\n },\n {\n child: 'GameEntity',\n parents: ['GameField', 'GameOverlay'],\n },\n {\n child: 'GameOverlay',\n parents: ['GameField'],\n },\n ],\n} as const satisfies ZoraPluginMetadata;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GameEntityProps } from '../../../../types/gamePresentation';
|
|
2
|
+
/*** Render one generic positioned game entity without owning gameplay semantics. */
|
|
3
|
+
export declare function GameEntity({ children, x, y, width, height, opacity, scale, rotation, zIndex, hidden, pointerEvents, accessibilityLabel, testID, }: GameEntityProps): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=GameEntity.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { View } from '@ankhorage/zora';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
/*** Render one generic positioned game entity without owning gameplay semantics. */
|
|
4
|
+
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
|
+
return (<View {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })} {...(testID === undefined ? {} : { testID })} pointerEvents={pointerEvents} style={[
|
|
6
|
+
styles.root,
|
|
7
|
+
createEntityStyle({ x, y, width, height, opacity, scale, rotation, zIndex, hidden }),
|
|
8
|
+
]}>
|
|
9
|
+
{children}
|
|
10
|
+
</View>);
|
|
11
|
+
}
|
|
12
|
+
/*** Convert serializable entity presentation props into a React Native view style. */
|
|
13
|
+
function createEntityStyle({ x, y, width, height, opacity, scale, rotation, zIndex, hidden, }) {
|
|
14
|
+
return {
|
|
15
|
+
display: hidden ? 'none' : 'flex',
|
|
16
|
+
left: toPercent(x),
|
|
17
|
+
opacity: clamp(opacity, 0, 1),
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
top: toPercent(y),
|
|
20
|
+
transform: [{ scale }, { rotate: `${rotation}deg` }],
|
|
21
|
+
zIndex,
|
|
22
|
+
...(height === undefined ? {} : { height }),
|
|
23
|
+
...(width === undefined ? {} : { width }),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
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
|
+
const styles = StyleSheet.create({
|
|
35
|
+
root: {
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=GameEntity.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GameFieldProps } from '../../../../types/gamePresentation';
|
|
2
|
+
/*** Render a bounded relative-positioning surface for game presentation content. */
|
|
3
|
+
export declare function GameField({ children, aspectRatio, minHeight, clip, accessibilityLabel, testID, }: GameFieldProps): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=GameField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameField.d.ts","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,WAAW,EACX,SAAe,EACf,IAAW,EACX,kBAAkB,EAClB,MAAM,GACP,EAAE,cAAc,+BAiBhB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { View } from '@ankhorage/zora';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
/*** Render a bounded relative-positioning surface for game presentation content. */
|
|
4
|
+
export function GameField({ children, aspectRatio, minHeight = 240, clip = true, accessibilityLabel, testID, }) {
|
|
5
|
+
return (<View {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })} {...(testID === undefined ? {} : { testID })} style={[
|
|
6
|
+
styles.root,
|
|
7
|
+
clip ? styles.clipped : styles.overflowVisible,
|
|
8
|
+
{
|
|
9
|
+
...(aspectRatio === undefined ? {} : { aspectRatio }),
|
|
10
|
+
minHeight,
|
|
11
|
+
},
|
|
12
|
+
]}>
|
|
13
|
+
{children}
|
|
14
|
+
</View>);
|
|
15
|
+
}
|
|
16
|
+
const styles = StyleSheet.create({
|
|
17
|
+
clipped: {
|
|
18
|
+
overflow: 'hidden',
|
|
19
|
+
},
|
|
20
|
+
overflowVisible: {
|
|
21
|
+
overflow: 'visible',
|
|
22
|
+
},
|
|
23
|
+
root: {
|
|
24
|
+
position: 'relative',
|
|
25
|
+
width: '100%',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=GameField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameField.js","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,oFAAoF;AACpF,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,WAAW,EACX,SAAS,GAAG,GAAG,EACf,IAAI,GAAG,IAAI,EACX,kBAAkB,EAClB,MAAM,GACS;IACf,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,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe;YAC9C;gBACE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;gBACrD,SAAS;aACV;SACF,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,QAAQ,EAAE,QAAQ;KACnB;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,SAAS;KACpB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC","sourcesContent":["import { View } from '@ankhorage/zora';\nimport { StyleSheet } from 'react-native';\n\nimport type { GameFieldProps } from '../../../../types/gamePresentation';\n\n/*** Render a bounded relative-positioning surface for game presentation content. */\nexport function GameField({\n children,\n aspectRatio,\n minHeight = 240,\n clip = true,\n accessibilityLabel,\n testID,\n}: GameFieldProps) {\n return (\n <View\n {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })}\n {...(testID === undefined ? {} : { testID })}\n style={[\n styles.root,\n clip ? styles.clipped : styles.overflowVisible,\n {\n ...(aspectRatio === undefined ? {} : { aspectRatio }),\n minHeight,\n },\n ]}\n >\n {children}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n clipped: {\n overflow: 'hidden',\n },\n overflowVisible: {\n overflow: 'visible',\n },\n root: {\n position: 'relative',\n width: '100%',\n },\n});\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GameOverlayProps } from '../../../../types/gamePresentation';
|
|
2
|
+
/*** Render an absolute game presentation layer for HUD, feedback, and phase content. */
|
|
3
|
+
export declare function GameOverlay({ children, placement, blocking, padding, accessibilityLabel, testID, }: GameOverlayProps): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=GameOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameOverlay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEjG,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAkB,EAClB,QAAgB,EAChB,OAAW,EACX,kBAAkB,EAClB,MAAM,GACP,EAAE,gBAAgB,+BAWlB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { View } from '@ankhorage/zora';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
/*** Render an absolute game presentation layer for HUD, feedback, and phase content. */
|
|
4
|
+
export function GameOverlay({ children, placement = 'fill', blocking = false, padding = 0, accessibilityLabel, testID, }) {
|
|
5
|
+
return (<View {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })} {...(testID === undefined ? {} : { testID })} pointerEvents={blocking ? 'auto' : 'box-none'} style={[styles.root, resolvePlacementStyle(placement), { padding }]}>
|
|
6
|
+
{children}
|
|
7
|
+
</View>);
|
|
8
|
+
}
|
|
9
|
+
/*** Resolve overlay alignment without coupling layout to any game genre or rule. */
|
|
10
|
+
function resolvePlacementStyle(placement) {
|
|
11
|
+
switch (placement) {
|
|
12
|
+
case 'center':
|
|
13
|
+
return { alignItems: 'center', justifyContent: 'center' };
|
|
14
|
+
case 'top':
|
|
15
|
+
return { alignItems: 'center', justifyContent: 'flex-start' };
|
|
16
|
+
case 'bottom':
|
|
17
|
+
return { alignItems: 'center', justifyContent: 'flex-end' };
|
|
18
|
+
case 'top-left':
|
|
19
|
+
return { alignItems: 'flex-start', justifyContent: 'flex-start' };
|
|
20
|
+
case 'top-right':
|
|
21
|
+
return { alignItems: 'flex-end', justifyContent: 'flex-start' };
|
|
22
|
+
case 'bottom-left':
|
|
23
|
+
return { alignItems: 'flex-start', justifyContent: 'flex-end' };
|
|
24
|
+
case 'bottom-right':
|
|
25
|
+
return { alignItems: 'flex-end', justifyContent: 'flex-end' };
|
|
26
|
+
case 'fill':
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
root: {
|
|
32
|
+
bottom: 0,
|
|
33
|
+
left: 0,
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
right: 0,
|
|
36
|
+
top: 0,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=GameOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameOverlay.js","sourceRoot":"","sources":["../../../../../src/features/game-presentation/adapters/inbound/GameOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAI1D,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GAAG,MAAM,EAClB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,CAAC,EACX,kBAAkB,EAClB,MAAM,GACW;IACjB,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,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAC9C,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAEpE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,oFAAoF;AACpF,SAAS,qBAAqB,CAAC,SAA+B;IAC5D,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;QAC5D,KAAK,KAAK;YACR,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;QAChE,KAAK,QAAQ;YACX,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;QAC9D,KAAK,UAAU;YACb,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;QACpE,KAAK,WAAW;YACd,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;QAClE,KAAK,aAAa;YAChB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;QAClE,KAAK,cAAc;YACjB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;QAChE,KAAK,MAAM;YACT,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAC","sourcesContent":["import { View } from '@ankhorage/zora';\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nimport type { GameOverlayPlacement, GameOverlayProps } from '../../../../types/gamePresentation';\n\n/*** Render an absolute game presentation layer for HUD, feedback, and phase content. */\nexport function GameOverlay({\n children,\n placement = 'fill',\n blocking = false,\n padding = 0,\n accessibilityLabel,\n testID,\n}: GameOverlayProps) {\n return (\n <View\n {...(accessibilityLabel === undefined ? {} : { accessibilityLabel })}\n {...(testID === undefined ? {} : { testID })}\n pointerEvents={blocking ? 'auto' : 'box-none'}\n style={[styles.root, resolvePlacementStyle(placement), { padding }]}\n >\n {children}\n </View>\n );\n}\n\n/*** Resolve overlay alignment without coupling layout to any game genre or rule. */\nfunction resolvePlacementStyle(placement: GameOverlayPlacement): ViewStyle {\n switch (placement) {\n case 'center':\n return { alignItems: 'center', justifyContent: 'center' };\n case 'top':\n return { alignItems: 'center', justifyContent: 'flex-start' };\n case 'bottom':\n return { alignItems: 'center', justifyContent: 'flex-end' };\n case 'top-left':\n return { alignItems: 'flex-start', justifyContent: 'flex-start' };\n case 'top-right':\n return { alignItems: 'flex-end', justifyContent: 'flex-start' };\n case 'bottom-left':\n return { alignItems: 'flex-start', justifyContent: 'flex-end' };\n case 'bottom-right':\n return { alignItems: 'flex-end', justifyContent: 'flex-end' };\n case 'fill':\n return {};\n }\n}\n\nconst styles = StyleSheet.create({\n root: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n"]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*** Describe one positioned generic game entity for ZORA authoring tools. */
|
|
2
|
+
export declare const gameEntityMeta: {
|
|
3
|
+
readonly name: "GameEntity";
|
|
4
|
+
readonly category: "component";
|
|
5
|
+
readonly description: "Positions arbitrary visual content inside a GameField without owning game rules.";
|
|
6
|
+
readonly directManifestNode: true;
|
|
7
|
+
readonly allowedChildren: readonly ["Badge", "Icon", "Image", "Text", "View"];
|
|
8
|
+
readonly blueprint: {
|
|
9
|
+
readonly label: "Game entity";
|
|
10
|
+
readonly defaultProps: {
|
|
11
|
+
readonly x: 0;
|
|
12
|
+
readonly y: 0;
|
|
13
|
+
readonly opacity: 1;
|
|
14
|
+
readonly scale: 1;
|
|
15
|
+
readonly rotation: 0;
|
|
16
|
+
readonly zIndex: 0;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly props: {
|
|
20
|
+
readonly x: {
|
|
21
|
+
readonly type: "number";
|
|
22
|
+
readonly category: "Position";
|
|
23
|
+
readonly label: "X (%)";
|
|
24
|
+
readonly default: 0;
|
|
25
|
+
readonly authoring: {
|
|
26
|
+
readonly authority: "instance";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly y: {
|
|
30
|
+
readonly type: "number";
|
|
31
|
+
readonly category: "Position";
|
|
32
|
+
readonly label: "Y (%)";
|
|
33
|
+
readonly default: 0;
|
|
34
|
+
readonly authoring: {
|
|
35
|
+
readonly authority: "instance";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly width: {
|
|
39
|
+
readonly type: "number";
|
|
40
|
+
readonly category: "Size";
|
|
41
|
+
readonly label: "Width";
|
|
42
|
+
readonly authoring: {
|
|
43
|
+
readonly authority: "instance";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly height: {
|
|
47
|
+
readonly type: "number";
|
|
48
|
+
readonly category: "Size";
|
|
49
|
+
readonly label: "Height";
|
|
50
|
+
readonly authoring: {
|
|
51
|
+
readonly authority: "instance";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly opacity: {
|
|
55
|
+
readonly type: "number";
|
|
56
|
+
readonly category: "Appearance";
|
|
57
|
+
readonly label: "Opacity";
|
|
58
|
+
readonly default: 1;
|
|
59
|
+
readonly authoring: {
|
|
60
|
+
readonly authority: "instance";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly scale: {
|
|
64
|
+
readonly type: "number";
|
|
65
|
+
readonly category: "Transform";
|
|
66
|
+
readonly label: "Scale";
|
|
67
|
+
readonly default: 1;
|
|
68
|
+
readonly authoring: {
|
|
69
|
+
readonly authority: "instance";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly rotation: {
|
|
73
|
+
readonly type: "number";
|
|
74
|
+
readonly category: "Transform";
|
|
75
|
+
readonly label: "Rotation";
|
|
76
|
+
readonly default: 0;
|
|
77
|
+
readonly authoring: {
|
|
78
|
+
readonly authority: "instance";
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly zIndex: {
|
|
82
|
+
readonly type: "number";
|
|
83
|
+
readonly category: "Position";
|
|
84
|
+
readonly label: "Z index";
|
|
85
|
+
readonly default: 0;
|
|
86
|
+
readonly authoring: {
|
|
87
|
+
readonly authority: "instance";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly hidden: {
|
|
91
|
+
readonly type: "boolean";
|
|
92
|
+
readonly category: "State";
|
|
93
|
+
readonly label: "Hidden";
|
|
94
|
+
readonly default: false;
|
|
95
|
+
readonly authoring: {
|
|
96
|
+
readonly authority: "instance";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly pointerEvents: {
|
|
100
|
+
readonly type: "enum";
|
|
101
|
+
readonly category: "Interaction";
|
|
102
|
+
readonly label: "Pointer events";
|
|
103
|
+
readonly enum: readonly ["auto", "box-none", "box-only", "none"];
|
|
104
|
+
readonly default: "auto";
|
|
105
|
+
readonly authoring: {
|
|
106
|
+
readonly authority: "instance";
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
readonly accessibilityLabel: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
readonly category: "Accessibility";
|
|
112
|
+
readonly label: "Accessibility label";
|
|
113
|
+
readonly authoring: {
|
|
114
|
+
readonly authority: "instance";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=gameEntityMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gameEntityMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/game-presentation/meta/gameEntityMeta.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuFW,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*** Describe one positioned generic game entity for ZORA authoring tools. */
|
|
2
|
+
export const gameEntityMeta = {
|
|
3
|
+
name: 'GameEntity',
|
|
4
|
+
category: 'component',
|
|
5
|
+
description: 'Positions arbitrary visual content inside a GameField without owning game rules.',
|
|
6
|
+
directManifestNode: true,
|
|
7
|
+
allowedChildren: ['Badge', 'Icon', 'Image', 'Text', 'View'],
|
|
8
|
+
blueprint: {
|
|
9
|
+
label: 'Game entity',
|
|
10
|
+
defaultProps: { x: 0, y: 0, opacity: 1, scale: 1, rotation: 0, zIndex: 0 },
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
x: {
|
|
14
|
+
type: 'number',
|
|
15
|
+
category: 'Position',
|
|
16
|
+
label: 'X (%)',
|
|
17
|
+
default: 0,
|
|
18
|
+
authoring: { authority: 'instance' },
|
|
19
|
+
},
|
|
20
|
+
y: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
category: 'Position',
|
|
23
|
+
label: 'Y (%)',
|
|
24
|
+
default: 0,
|
|
25
|
+
authoring: { authority: 'instance' },
|
|
26
|
+
},
|
|
27
|
+
width: {
|
|
28
|
+
type: 'number',
|
|
29
|
+
category: 'Size',
|
|
30
|
+
label: 'Width',
|
|
31
|
+
authoring: { authority: 'instance' },
|
|
32
|
+
},
|
|
33
|
+
height: {
|
|
34
|
+
type: 'number',
|
|
35
|
+
category: 'Size',
|
|
36
|
+
label: 'Height',
|
|
37
|
+
authoring: { authority: 'instance' },
|
|
38
|
+
},
|
|
39
|
+
opacity: {
|
|
40
|
+
type: 'number',
|
|
41
|
+
category: 'Appearance',
|
|
42
|
+
label: 'Opacity',
|
|
43
|
+
default: 1,
|
|
44
|
+
authoring: { authority: 'instance' },
|
|
45
|
+
},
|
|
46
|
+
scale: {
|
|
47
|
+
type: 'number',
|
|
48
|
+
category: 'Transform',
|
|
49
|
+
label: 'Scale',
|
|
50
|
+
default: 1,
|
|
51
|
+
authoring: { authority: 'instance' },
|
|
52
|
+
},
|
|
53
|
+
rotation: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
category: 'Transform',
|
|
56
|
+
label: 'Rotation',
|
|
57
|
+
default: 0,
|
|
58
|
+
authoring: { authority: 'instance' },
|
|
59
|
+
},
|
|
60
|
+
zIndex: {
|
|
61
|
+
type: 'number',
|
|
62
|
+
category: 'Position',
|
|
63
|
+
label: 'Z index',
|
|
64
|
+
default: 0,
|
|
65
|
+
authoring: { authority: 'instance' },
|
|
66
|
+
},
|
|
67
|
+
hidden: {
|
|
68
|
+
type: 'boolean',
|
|
69
|
+
category: 'State',
|
|
70
|
+
label: 'Hidden',
|
|
71
|
+
default: false,
|
|
72
|
+
authoring: { authority: 'instance' },
|
|
73
|
+
},
|
|
74
|
+
pointerEvents: {
|
|
75
|
+
type: 'enum',
|
|
76
|
+
category: 'Interaction',
|
|
77
|
+
label: 'Pointer events',
|
|
78
|
+
enum: ['auto', 'box-none', 'box-only', 'none'],
|
|
79
|
+
default: 'auto',
|
|
80
|
+
authoring: { authority: 'instance' },
|
|
81
|
+
},
|
|
82
|
+
accessibilityLabel: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
category: 'Accessibility',
|
|
85
|
+
label: 'Accessibility label',
|
|
86
|
+
authoring: { authority: 'instance' },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=gameEntityMeta.js.map
|