@ankhorage/zora-tabletop 0.0.9 → 0.1.1
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 +16 -0
- package/README.md +45 -1
- package/dist/features/game-presentations/adapters/inbound/PokerTrainingTable.d.ts +16 -0
- package/dist/features/game-presentations/adapters/inbound/PokerTrainingTable.d.ts.map +1 -0
- package/dist/features/game-presentations/adapters/inbound/PokerTrainingTable.js +20 -0
- package/dist/features/game-presentations/adapters/inbound/PokerTrainingTable.js.map +1 -0
- package/dist/features/game-presentations/adapters/inbound/createPokerTrainingTableState.d.ts +13 -0
- package/dist/features/game-presentations/adapters/inbound/createPokerTrainingTableState.d.ts.map +1 -0
- package/dist/features/game-presentations/adapters/inbound/createPokerTrainingTableState.js +98 -0
- package/dist/features/game-presentations/adapters/inbound/createPokerTrainingTableState.js.map +1 -0
- package/dist/features/game-presentations/adapters/inbound/pokerTrainingTableMeta.d.ts +110 -0
- package/dist/features/game-presentations/adapters/inbound/pokerTrainingTableMeta.d.ts.map +1 -0
- package/dist/features/game-presentations/adapters/inbound/pokerTrainingTableMeta.js +81 -0
- package/dist/features/game-presentations/adapters/inbound/pokerTrainingTableMeta.js.map +1 -0
- package/dist/features/game-presentations/domain/createTabletopGameSeats.d.ts +25 -0
- package/dist/features/game-presentations/domain/createTabletopGameSeats.d.ts.map +1 -0
- package/dist/features/game-presentations/domain/createTabletopGameSeats.js +33 -0
- package/dist/features/game-presentations/domain/createTabletopGameSeats.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/meta.d.ts +145 -0
- package/dist/meta.d.ts.map +1 -0
- package/dist/meta.js +115 -0
- package/dist/meta.js.map +1 -0
- package/dist/plugin.d.ts +277 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +9 -0
- package/dist/plugin.js.map +1 -0
- package/dist/registry.d.ts +522 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +22 -0
- package/dist/registry.js.map +1 -0
- package/dist/types/gamePresentation.d.ts +16 -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/dist/types/pokerTraining.d.ts +42 -0
- package/dist/types/pokerTraining.d.ts.map +1 -0
- package/dist/types/pokerTraining.js +2 -0
- package/dist/types/pokerTraining.js.map +1 -0
- package/package.json +12 -5
- package/src/features/game-presentations/adapters/inbound/PokerTrainingTable.tsx +41 -0
- package/src/features/game-presentations/adapters/inbound/createPokerTrainingTableState.test.ts +130 -0
- package/src/features/game-presentations/adapters/inbound/createPokerTrainingTableState.ts +133 -0
- package/src/features/game-presentations/adapters/inbound/pokerTrainingTableMeta.ts +80 -0
- package/src/features/game-presentations/domain/createTabletopGameSeats.test.ts +55 -0
- package/src/features/game-presentations/domain/createTabletopGameSeats.ts +43 -0
- package/src/index.ts +20 -0
- package/src/meta.test.ts +54 -0
- package/src/meta.ts +114 -0
- package/src/plugin.ts +10 -0
- package/src/registry.ts +23 -0
- package/src/types/gamePresentation.ts +19 -0
- package/src/types/pokerTraining.ts +51 -0
package/src/meta.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export const tabletopTableMeta = {
|
|
2
|
+
name: 'TabletopTable',
|
|
3
|
+
category: 'component',
|
|
4
|
+
description: 'Arranges player seats and shared cards around a responsive tabletop surface.',
|
|
5
|
+
directManifestNode: true,
|
|
6
|
+
allowedChildren: [],
|
|
7
|
+
blueprint: {
|
|
8
|
+
label: 'Tabletop table',
|
|
9
|
+
defaultProps: {
|
|
10
|
+
seats: [],
|
|
11
|
+
centerCards: [],
|
|
12
|
+
shape: 'oval',
|
|
13
|
+
cardSize: 'small',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
bindings: {
|
|
17
|
+
props: {
|
|
18
|
+
seats: {
|
|
19
|
+
label: 'Seats',
|
|
20
|
+
value: { type: 'array', itemType: 'object' },
|
|
21
|
+
acceptsFallback: true,
|
|
22
|
+
acceptsTransforms: true,
|
|
23
|
+
},
|
|
24
|
+
centerCards: {
|
|
25
|
+
label: 'Center cards',
|
|
26
|
+
value: { type: 'array', itemType: 'object' },
|
|
27
|
+
acceptsFallback: true,
|
|
28
|
+
acceptsTransforms: true,
|
|
29
|
+
},
|
|
30
|
+
centerLabel: {
|
|
31
|
+
label: 'Center label',
|
|
32
|
+
value: { type: 'string' },
|
|
33
|
+
acceptsFallback: true,
|
|
34
|
+
acceptsTransforms: true,
|
|
35
|
+
},
|
|
36
|
+
centerSublabel: {
|
|
37
|
+
label: 'Center sublabel',
|
|
38
|
+
value: { type: 'string' },
|
|
39
|
+
acceptsFallback: true,
|
|
40
|
+
acceptsTransforms: true,
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
label: 'Disabled',
|
|
44
|
+
value: { type: 'boolean' },
|
|
45
|
+
acceptsFallback: true,
|
|
46
|
+
acceptsTransforms: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
seats: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
category: 'Players',
|
|
54
|
+
label: 'Seats',
|
|
55
|
+
default: [],
|
|
56
|
+
authoring: { authority: 'instance' },
|
|
57
|
+
},
|
|
58
|
+
centerCards: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
category: 'Table',
|
|
61
|
+
label: 'Center cards',
|
|
62
|
+
default: [],
|
|
63
|
+
authoring: { authority: 'instance' },
|
|
64
|
+
},
|
|
65
|
+
centerLabel: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
category: 'Table',
|
|
68
|
+
label: 'Center label',
|
|
69
|
+
authoring: { authority: 'instance' },
|
|
70
|
+
},
|
|
71
|
+
centerSublabel: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
category: 'Table',
|
|
74
|
+
label: 'Center sublabel',
|
|
75
|
+
authoring: { authority: 'instance' },
|
|
76
|
+
},
|
|
77
|
+
shape: {
|
|
78
|
+
type: 'enum',
|
|
79
|
+
category: 'Table',
|
|
80
|
+
label: 'Shape',
|
|
81
|
+
enum: ['circle', 'oval', 'rounded'],
|
|
82
|
+
default: 'oval',
|
|
83
|
+
authoring: { authority: 'instance' },
|
|
84
|
+
},
|
|
85
|
+
seatCount: {
|
|
86
|
+
type: 'enum',
|
|
87
|
+
category: 'Players',
|
|
88
|
+
label: 'Seat count',
|
|
89
|
+
enum: [2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
90
|
+
authoring: { authority: 'instance' },
|
|
91
|
+
},
|
|
92
|
+
cardSize: {
|
|
93
|
+
type: 'enum',
|
|
94
|
+
category: 'Cards',
|
|
95
|
+
label: 'Card size',
|
|
96
|
+
enum: ['small', 'medium', 'large'],
|
|
97
|
+
default: 'small',
|
|
98
|
+
authoring: { authority: 'instance' },
|
|
99
|
+
},
|
|
100
|
+
disabled: {
|
|
101
|
+
type: 'boolean',
|
|
102
|
+
category: 'State',
|
|
103
|
+
label: 'Disabled',
|
|
104
|
+
default: false,
|
|
105
|
+
authoring: { authority: 'instance' },
|
|
106
|
+
},
|
|
107
|
+
accessibilityLabel: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
category: 'Accessibility',
|
|
110
|
+
label: 'Accessibility label',
|
|
111
|
+
authoring: { authority: 'instance' },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
} as const;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabletopTable } from './components/tabletop-table';
|
|
2
|
+
import { PokerTrainingTable } from './features/game-presentations/adapters/inbound/PokerTrainingTable';
|
|
3
|
+
import { ZORA_PLUGIN_METADATA } from './registry';
|
|
4
|
+
|
|
5
|
+
export const ZORA_TABLETOP_COMPONENT_REGISTRY = { PokerTrainingTable, TabletopTable } as const;
|
|
6
|
+
|
|
7
|
+
export const ZORA_TABLETOP_PLUGIN = {
|
|
8
|
+
...ZORA_PLUGIN_METADATA,
|
|
9
|
+
componentRegistry: ZORA_TABLETOP_COMPONENT_REGISTRY,
|
|
10
|
+
} as const;
|
package/src/registry.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { pokerTrainingTableMeta } from './features/game-presentations/adapters/inbound/pokerTrainingTableMeta';
|
|
2
|
+
import { tabletopTableMeta } from './meta';
|
|
3
|
+
|
|
4
|
+
export const ZORA_TABLETOP_COMPONENT_META = {
|
|
5
|
+
PokerTrainingTable: pokerTrainingTableMeta,
|
|
6
|
+
TabletopTable: tabletopTableMeta,
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
export const ZORA_PLUGIN_METADATA = {
|
|
10
|
+
packageName: '@ankhorage/zora-tabletop',
|
|
11
|
+
displayName: 'ZORA Tabletop',
|
|
12
|
+
componentMeta: ZORA_TABLETOP_COMPONENT_META,
|
|
13
|
+
placements: [
|
|
14
|
+
{
|
|
15
|
+
child: 'PokerTrainingTable',
|
|
16
|
+
parents: ['Box', 'Card', 'Container', 'Grid', 'Panel', 'Screen', 'ScreenSection', 'Stack'],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
child: 'TabletopTable',
|
|
20
|
+
parents: ['Box', 'Card', 'Container', 'Grid', 'Panel', 'Screen', 'ScreenSection', 'Stack'],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
} as const;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TabletopSeatState } from '../types';
|
|
2
|
+
|
|
3
|
+
export type TabletopGameSeatPresentation = Omit<TabletopSeatState, 'id'>;
|
|
4
|
+
|
|
5
|
+
export interface TabletopGameSeatDefinition {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly defaultState: TabletopGameSeatPresentation;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TabletopGameParticipantState {
|
|
11
|
+
readonly seatId: string;
|
|
12
|
+
readonly state: Partial<TabletopGameSeatPresentation>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CreateTabletopGameSeatsInput {
|
|
16
|
+
readonly seats: readonly TabletopGameSeatDefinition[];
|
|
17
|
+
readonly participants: readonly TabletopGameParticipantState[];
|
|
18
|
+
readonly missingParticipantState?: Partial<TabletopGameSeatPresentation>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TabletopColorOverrides } from '../colors';
|
|
2
|
+
import type {
|
|
3
|
+
PlayingCardValue,
|
|
4
|
+
TabletopCardSize,
|
|
5
|
+
TabletopSeatState,
|
|
6
|
+
TabletopShape,
|
|
7
|
+
} from '../types';
|
|
8
|
+
|
|
9
|
+
export interface PokerTrainingPlayer {
|
|
10
|
+
readonly position: string;
|
|
11
|
+
readonly stack?: number;
|
|
12
|
+
readonly bet?: number;
|
|
13
|
+
readonly cards?: readonly PlayingCardValue[];
|
|
14
|
+
readonly folded?: boolean;
|
|
15
|
+
readonly isHero?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PokerTrainingTaskTableData {
|
|
19
|
+
readonly blinds?: {
|
|
20
|
+
readonly small: number;
|
|
21
|
+
readonly big: number;
|
|
22
|
+
};
|
|
23
|
+
readonly heroPosition?: string;
|
|
24
|
+
readonly heroCards?: readonly PlayingCardValue[];
|
|
25
|
+
readonly communityCards?: readonly PlayingCardValue[];
|
|
26
|
+
readonly pot?: number;
|
|
27
|
+
readonly players?: readonly PokerTrainingPlayer[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CreatePokerTrainingTableStateOptions {
|
|
31
|
+
readonly defaultStackBigBlinds?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface PokerTrainingTableState {
|
|
35
|
+
readonly seats: readonly TabletopSeatState[];
|
|
36
|
+
readonly centerCards: readonly PlayingCardValue[];
|
|
37
|
+
readonly centerLabel?: string;
|
|
38
|
+
readonly centerSublabel?: string;
|
|
39
|
+
readonly accessibilityLabel: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PokerTrainingTableProps {
|
|
43
|
+
readonly task?: PokerTrainingTaskTableData;
|
|
44
|
+
readonly defaultStackBigBlinds?: number;
|
|
45
|
+
readonly shape?: TabletopShape;
|
|
46
|
+
readonly cardSize?: TabletopCardSize;
|
|
47
|
+
readonly disabled?: boolean;
|
|
48
|
+
readonly colorScheme?: TabletopColorOverrides;
|
|
49
|
+
readonly accessibilityLabel?: string;
|
|
50
|
+
readonly testID?: string;
|
|
51
|
+
}
|