@agot/card-preview 1.0.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/README.md +16 -0
- package/dist/index.d.mts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +740 -0
- package/dist/index.mjs +707 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @throneteki-playtesting/card-preview
|
|
2
|
+
|
|
3
|
+
A lightweight React component library for rendering **A Game of Thrones LCG 2nd Edition** cards.
|
|
4
|
+
|
|
5
|
+
This library is installed directly from GitHub.
|
|
6
|
+
|
|
7
|
+
## 📦 Installation
|
|
8
|
+
|
|
9
|
+
To add this package to your project, run the following command:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install the latest from the master branch:
|
|
13
|
+
npm install throneteki-playtesting/got-automation#master:@agotCardPreview
|
|
14
|
+
|
|
15
|
+
# Install a specific version (Recommended for stability):
|
|
16
|
+
npm install throneteki-playtesting/got-automation#v1.1.0:@agotCardPreview
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] | undefined : T extends object ? {
|
|
5
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
6
|
+
} : T;
|
|
7
|
+
|
|
8
|
+
type Code$1 = `${number}`;
|
|
9
|
+
|
|
10
|
+
declare const factions: readonly ["baratheon", "greyjoy", "lannister", "martell", "thenightswatch", "stark", "targaryen", "tyrell", "neutral"];
|
|
11
|
+
declare const types: readonly ["character", "location", "attachment", "event", "plot", "agenda"];
|
|
12
|
+
type Faction = typeof factions[number];
|
|
13
|
+
type Type = typeof types[number];
|
|
14
|
+
type Code = `${Code$1}${number}`;
|
|
15
|
+
type Cost = number | "X" | "-";
|
|
16
|
+
type Strength = number | "X";
|
|
17
|
+
type PlotValue = number | "X";
|
|
18
|
+
type Quantity = 1 | 2 | 3;
|
|
19
|
+
/**
|
|
20
|
+
* Base released card, fitting structure of JSON Card Data Repository
|
|
21
|
+
*/
|
|
22
|
+
interface ICard {
|
|
23
|
+
code?: Code;
|
|
24
|
+
cost?: Cost;
|
|
25
|
+
deckLimit: number;
|
|
26
|
+
designer?: string;
|
|
27
|
+
faction: Faction;
|
|
28
|
+
flavor?: string;
|
|
29
|
+
icons?: Icons;
|
|
30
|
+
illustrator: string;
|
|
31
|
+
loyal?: boolean;
|
|
32
|
+
name: string;
|
|
33
|
+
plotStats?: PlotStats;
|
|
34
|
+
strength?: Strength;
|
|
35
|
+
traits: string[];
|
|
36
|
+
text: string;
|
|
37
|
+
type: Type;
|
|
38
|
+
unique?: boolean;
|
|
39
|
+
quantity: Quantity;
|
|
40
|
+
imageUrl?: string;
|
|
41
|
+
}
|
|
42
|
+
interface Icons {
|
|
43
|
+
military: boolean;
|
|
44
|
+
intrigue: boolean;
|
|
45
|
+
power: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface PlotStats {
|
|
48
|
+
income: PlotValue;
|
|
49
|
+
initiative: PlotValue;
|
|
50
|
+
claim: PlotValue;
|
|
51
|
+
reserve: PlotValue;
|
|
52
|
+
}
|
|
53
|
+
interface IRenderCard extends Omit<ICard, "code"> {
|
|
54
|
+
code?: Code;
|
|
55
|
+
key: string;
|
|
56
|
+
watermark: Watermark;
|
|
57
|
+
}
|
|
58
|
+
interface Watermark {
|
|
59
|
+
top?: string;
|
|
60
|
+
middle?: string;
|
|
61
|
+
bottom?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type BaseElementProps = {
|
|
65
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
66
|
+
className?: string;
|
|
67
|
+
style?: CSSProperties;
|
|
68
|
+
};
|
|
69
|
+
type CardComponentProps = Omit<BaseElementProps, "children"> & {
|
|
70
|
+
card: DeepPartial<IRenderCard>;
|
|
71
|
+
scale?: number;
|
|
72
|
+
orientation?: "horizontal" | "vertical";
|
|
73
|
+
rounded?: boolean;
|
|
74
|
+
} & React.DOMAttributes<HTMLDivElement>;
|
|
75
|
+
|
|
76
|
+
declare const CardPreview: ({ card, scale, orientation, rounded, className, style, ...props }: CardComponentProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
export { CardPreview as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] | undefined : T extends object ? {
|
|
5
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
6
|
+
} : T;
|
|
7
|
+
|
|
8
|
+
type Code$1 = `${number}`;
|
|
9
|
+
|
|
10
|
+
declare const factions: readonly ["baratheon", "greyjoy", "lannister", "martell", "thenightswatch", "stark", "targaryen", "tyrell", "neutral"];
|
|
11
|
+
declare const types: readonly ["character", "location", "attachment", "event", "plot", "agenda"];
|
|
12
|
+
type Faction = typeof factions[number];
|
|
13
|
+
type Type = typeof types[number];
|
|
14
|
+
type Code = `${Code$1}${number}`;
|
|
15
|
+
type Cost = number | "X" | "-";
|
|
16
|
+
type Strength = number | "X";
|
|
17
|
+
type PlotValue = number | "X";
|
|
18
|
+
type Quantity = 1 | 2 | 3;
|
|
19
|
+
/**
|
|
20
|
+
* Base released card, fitting structure of JSON Card Data Repository
|
|
21
|
+
*/
|
|
22
|
+
interface ICard {
|
|
23
|
+
code?: Code;
|
|
24
|
+
cost?: Cost;
|
|
25
|
+
deckLimit: number;
|
|
26
|
+
designer?: string;
|
|
27
|
+
faction: Faction;
|
|
28
|
+
flavor?: string;
|
|
29
|
+
icons?: Icons;
|
|
30
|
+
illustrator: string;
|
|
31
|
+
loyal?: boolean;
|
|
32
|
+
name: string;
|
|
33
|
+
plotStats?: PlotStats;
|
|
34
|
+
strength?: Strength;
|
|
35
|
+
traits: string[];
|
|
36
|
+
text: string;
|
|
37
|
+
type: Type;
|
|
38
|
+
unique?: boolean;
|
|
39
|
+
quantity: Quantity;
|
|
40
|
+
imageUrl?: string;
|
|
41
|
+
}
|
|
42
|
+
interface Icons {
|
|
43
|
+
military: boolean;
|
|
44
|
+
intrigue: boolean;
|
|
45
|
+
power: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface PlotStats {
|
|
48
|
+
income: PlotValue;
|
|
49
|
+
initiative: PlotValue;
|
|
50
|
+
claim: PlotValue;
|
|
51
|
+
reserve: PlotValue;
|
|
52
|
+
}
|
|
53
|
+
interface IRenderCard extends Omit<ICard, "code"> {
|
|
54
|
+
code?: Code;
|
|
55
|
+
key: string;
|
|
56
|
+
watermark: Watermark;
|
|
57
|
+
}
|
|
58
|
+
interface Watermark {
|
|
59
|
+
top?: string;
|
|
60
|
+
middle?: string;
|
|
61
|
+
bottom?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type BaseElementProps = {
|
|
65
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
66
|
+
className?: string;
|
|
67
|
+
style?: CSSProperties;
|
|
68
|
+
};
|
|
69
|
+
type CardComponentProps = Omit<BaseElementProps, "children"> & {
|
|
70
|
+
card: DeepPartial<IRenderCard>;
|
|
71
|
+
scale?: number;
|
|
72
|
+
orientation?: "horizontal" | "vertical";
|
|
73
|
+
rounded?: boolean;
|
|
74
|
+
} & React.DOMAttributes<HTMLDivElement>;
|
|
75
|
+
|
|
76
|
+
declare const CardPreview: ({ card, scale, orientation, rounded, className, style, ...props }: CardComponentProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
export { CardPreview as default };
|