@konoui/mjimage 0.0.16 → 0.0.18
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/dist/mjs/index.d.ts +1 -0
- package/dist/mjs/index.js +1 -0
- package/dist/mjs/lib/calculator/efficiency.d.ts +1 -1
- package/dist/mjs/lib/calculator/efficiency.js +6 -7
- package/dist/mjs/lib/controller/controller.d.ts +28 -38
- package/dist/mjs/lib/controller/controller.js +2 -2
- package/dist/mjs/lib/controller/events.js +3 -3
- package/dist/mjs/lib/controller/game.d.ts +3 -3
- package/dist/mjs/lib/controller/managers.d.ts +1 -1
- package/dist/mjs/lib/controller/managers.js +3 -3
- package/dist/mjs/lib/controller/river.d.ts +4 -4
- package/dist/mjs/lib/controller/state-machine.d.ts +2 -2
- package/dist/mjs/lib/controller/state-machine.js +2 -2
- package/dist/mjs/lib/core/index.d.ts +0 -1
- package/dist/mjs/lib/core/index.js +0 -1
- package/dist/mjs/lib/core/parser.d.ts +1 -1
- package/dist/mjs/lib/core/parser.js +82 -82
- package/dist/mjs/lib/{core → image}/image.d.ts +1 -1
- package/dist/mjs/lib/{core → image}/image.js +33 -33
- package/dist/mjs/lib/image/index.d.ts +1 -0
- package/dist/mjs/lib/image/index.js +17 -0
- package/dist/mjs/lib/measure-text/index.js +1 -1
- package/dist/mjs/lib/mjimage.d.ts +1 -1
- package/dist/mjs/lib/mjimage.js +2 -1
- package/dist/mjs/lib/table/table-parser.d.ts +51 -146
- package/dist/mjs/lib/table/table-parser.js +31 -41
- package/dist/mjs/lib/table/table.d.ts +2 -2
- package/dist/mjs/lib/table/table.js +5 -6
- package/package.json +7 -5
package/dist/mjs/lib/mjimage.js
CHANGED
|
@@ -13,6 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.mjimage = void 0;
|
|
15
15
|
var core_1 = require("./core");
|
|
16
|
+
var image_1 = require("./image");
|
|
16
17
|
var measure_text_1 = require("./measure-text");
|
|
17
18
|
var table_1 = require("./table");
|
|
18
19
|
var svg_js_1 = require("@svgdotjs/svg.js");
|
|
@@ -65,7 +66,7 @@ var mjimage = (function () {
|
|
|
65
66
|
else {
|
|
66
67
|
var scale = calculateScale(handScale, textHeight);
|
|
67
68
|
var blocks = new core_1.Parser(input).parse();
|
|
68
|
-
(0,
|
|
69
|
+
(0, image_1.drawBlocks)(svg, blocks, __assign(__assign({}, props), { svgSprite: svgSprite, scale: scale }), { responsive: responsive });
|
|
69
70
|
}
|
|
70
71
|
svg.addTo(target);
|
|
71
72
|
}
|
|
@@ -1,152 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InferOutput } from "valibot";
|
|
2
2
|
import { Tile, Block } from "../core/parser";
|
|
3
3
|
import { WIND_MAP, ROUND_MAP } from "../core/constants";
|
|
4
|
-
declare const tableInputSchema:
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
score: number;
|
|
26
|
-
}, {
|
|
27
|
-
discard?: string | undefined;
|
|
28
|
-
hand?: string | undefined;
|
|
29
|
-
score?: number | undefined;
|
|
30
|
-
}>>>;
|
|
31
|
-
"3w": z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
32
|
-
discard: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
33
|
-
hand: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
34
|
-
score: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
-
}, "strict", z.ZodTypeAny, {
|
|
36
|
-
discard: string;
|
|
37
|
-
hand: string;
|
|
38
|
-
score: number;
|
|
39
|
-
}, {
|
|
40
|
-
discard?: string | undefined;
|
|
41
|
-
hand?: string | undefined;
|
|
42
|
-
score?: number | undefined;
|
|
43
|
-
}>>>;
|
|
44
|
-
"4w": z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
45
|
-
discard: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
46
|
-
hand: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
|
-
score: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
48
|
-
}, "strict", z.ZodTypeAny, {
|
|
49
|
-
discard: string;
|
|
50
|
-
hand: string;
|
|
51
|
-
score: number;
|
|
52
|
-
}, {
|
|
53
|
-
discard?: string | undefined;
|
|
54
|
-
hand?: string | undefined;
|
|
55
|
-
score?: number | undefined;
|
|
56
|
-
}>>>;
|
|
57
|
-
board: z.ZodObject<{
|
|
58
|
-
round: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4">, z.ZodLiteral<"1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4">, ...z.ZodLiteral<"1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4">[]]>>>;
|
|
59
|
-
sticks: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
60
|
-
reach: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
61
|
-
dead: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
reach: number;
|
|
64
|
-
dead: number;
|
|
65
|
-
}, {
|
|
66
|
-
reach?: number | undefined;
|
|
67
|
-
dead?: number | undefined;
|
|
68
|
-
}>>>;
|
|
69
|
-
doras: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
70
|
-
front: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"1w" | "2w" | "3w" | "4w">, z.ZodLiteral<"1w" | "2w" | "3w" | "4w">, ...z.ZodLiteral<"1w" | "2w" | "3w" | "4w">[]]>>>;
|
|
71
|
-
}, "strict", z.ZodTypeAny, {
|
|
72
|
-
round: "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4";
|
|
73
|
-
front: "1w" | "2w" | "3w" | "4w";
|
|
74
|
-
sticks: {
|
|
75
|
-
reach: number;
|
|
76
|
-
dead: number;
|
|
77
|
-
};
|
|
78
|
-
doras: string[];
|
|
79
|
-
}, {
|
|
80
|
-
round?: "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4" | undefined;
|
|
81
|
-
sticks?: {
|
|
82
|
-
reach?: number | undefined;
|
|
83
|
-
dead?: number | undefined;
|
|
84
|
-
} | undefined;
|
|
85
|
-
doras?: string[] | undefined;
|
|
86
|
-
front?: "1w" | "2w" | "3w" | "4w" | undefined;
|
|
4
|
+
declare const tableInputSchema: import("valibot").StrictObjectSchema<{
|
|
5
|
+
readonly board: import("valibot").StrictObjectSchema<{
|
|
6
|
+
readonly round: import("valibot").OptionalSchema<import("valibot").PicklistSchema<("1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4")[], undefined>, "1w1">;
|
|
7
|
+
readonly sticks: import("valibot").OptionalSchema<import("valibot").StrictObjectSchema<{
|
|
8
|
+
readonly reach: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "">, import("valibot").MaxValueAction<number, 9, "">]>, 0>;
|
|
9
|
+
readonly dead: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "">, import("valibot").MaxValueAction<number, 9, "">]>, 0>;
|
|
10
|
+
}, undefined>, {
|
|
11
|
+
readonly reach: 0;
|
|
12
|
+
readonly dead: 0;
|
|
13
|
+
}>;
|
|
14
|
+
readonly doras: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, readonly ["3w"]>;
|
|
15
|
+
readonly front: import("valibot").OptionalSchema<import("valibot").PicklistSchema<("1w" | "2w" | "3w" | "4w")[], undefined>, "1w">;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
readonly "1w": import("valibot").OptionalSchema<import("valibot").StrictObjectSchema<{
|
|
18
|
+
readonly discard: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
19
|
+
readonly hand: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
20
|
+
readonly score: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 25000>;
|
|
21
|
+
}, undefined>, {
|
|
22
|
+
readonly discard: "";
|
|
23
|
+
readonly hand: "";
|
|
24
|
+
readonly score: 25000;
|
|
87
25
|
}>;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
}, {
|
|
119
|
-
board: {
|
|
120
|
-
round?: "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4" | undefined;
|
|
121
|
-
sticks?: {
|
|
122
|
-
reach?: number | undefined;
|
|
123
|
-
dead?: number | undefined;
|
|
124
|
-
} | undefined;
|
|
125
|
-
doras?: string[] | undefined;
|
|
126
|
-
front?: "1w" | "2w" | "3w" | "4w" | undefined;
|
|
127
|
-
};
|
|
128
|
-
"1w"?: {
|
|
129
|
-
discard?: string | undefined;
|
|
130
|
-
hand?: string | undefined;
|
|
131
|
-
score?: number | undefined;
|
|
132
|
-
} | undefined;
|
|
133
|
-
"2w"?: {
|
|
134
|
-
discard?: string | undefined;
|
|
135
|
-
hand?: string | undefined;
|
|
136
|
-
score?: number | undefined;
|
|
137
|
-
} | undefined;
|
|
138
|
-
"3w"?: {
|
|
139
|
-
discard?: string | undefined;
|
|
140
|
-
hand?: string | undefined;
|
|
141
|
-
score?: number | undefined;
|
|
142
|
-
} | undefined;
|
|
143
|
-
"4w"?: {
|
|
144
|
-
discard?: string | undefined;
|
|
145
|
-
hand?: string | undefined;
|
|
146
|
-
score?: number | undefined;
|
|
147
|
-
} | undefined;
|
|
148
|
-
}>;
|
|
149
|
-
export type TableInput = z.infer<typeof tableInputSchema>;
|
|
26
|
+
readonly "2w": import("valibot").OptionalSchema<import("valibot").StrictObjectSchema<{
|
|
27
|
+
readonly discard: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
28
|
+
readonly hand: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
29
|
+
readonly score: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 25000>;
|
|
30
|
+
}, undefined>, {
|
|
31
|
+
readonly discard: "";
|
|
32
|
+
readonly hand: "";
|
|
33
|
+
readonly score: 25000;
|
|
34
|
+
}>;
|
|
35
|
+
readonly "3w": import("valibot").OptionalSchema<import("valibot").StrictObjectSchema<{
|
|
36
|
+
readonly discard: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
37
|
+
readonly hand: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
38
|
+
readonly score: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 25000>;
|
|
39
|
+
}, undefined>, {
|
|
40
|
+
readonly discard: "";
|
|
41
|
+
readonly hand: "";
|
|
42
|
+
readonly score: 25000;
|
|
43
|
+
}>;
|
|
44
|
+
readonly "4w": import("valibot").OptionalSchema<import("valibot").StrictObjectSchema<{
|
|
45
|
+
readonly discard: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
46
|
+
readonly hand: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
47
|
+
readonly score: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 25000>;
|
|
48
|
+
}, undefined>, {
|
|
49
|
+
readonly discard: "";
|
|
50
|
+
readonly hand: "";
|
|
51
|
+
readonly score: 25000;
|
|
52
|
+
}>;
|
|
53
|
+
}, undefined>;
|
|
54
|
+
export type TableInput = InferOutput<typeof tableInputSchema>;
|
|
150
55
|
export interface DiscardsInput {
|
|
151
56
|
front: Tile[];
|
|
152
57
|
right: Tile[];
|
|
@@ -1,53 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var _a;
|
|
3
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
15
|
exports.convertInput = exports.parseTableInput = exports.parse = void 0;
|
|
5
16
|
var js_yaml_1 = require("js-yaml");
|
|
6
|
-
var
|
|
17
|
+
var valibot_1 = require("valibot");
|
|
7
18
|
var parser_1 = require("../core/parser");
|
|
8
19
|
var constants_1 = require("../core/constants");
|
|
9
|
-
var windInputSchema =
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
.strict()
|
|
16
|
-
.optional()
|
|
17
|
-
.default({ discard: "", hand: "", score: 25000 });
|
|
18
|
-
var windInputsSchema = zod_1.z
|
|
19
|
-
.object((_a = {},
|
|
20
|
+
var windInputSchema = (0, valibot_1.optional)((0, valibot_1.strictObject)({
|
|
21
|
+
discard: (0, valibot_1.optional)((0, valibot_1.string)(), ""),
|
|
22
|
+
hand: (0, valibot_1.optional)((0, valibot_1.string)(), ""),
|
|
23
|
+
score: (0, valibot_1.optional)((0, valibot_1.number)(), 25000),
|
|
24
|
+
}), { discard: "", hand: "", score: 25000 });
|
|
25
|
+
var windInputsSchema = (0, valibot_1.strictObject)((_a = {},
|
|
20
26
|
_a[constants_1.WIND.EAST] = windInputSchema,
|
|
21
27
|
_a[constants_1.WIND.SOUTH] = windInputSchema,
|
|
22
28
|
_a[constants_1.WIND.WEST] = windInputSchema,
|
|
23
29
|
_a[constants_1.WIND.NORTH] = windInputSchema,
|
|
24
|
-
_a))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
.optional()
|
|
34
|
-
.default("1w1"),
|
|
35
|
-
sticks: zod_1.z
|
|
36
|
-
.object({
|
|
37
|
-
reach: zod_1.z.number().max(9).gte(0).optional().default(0),
|
|
38
|
-
dead: zod_1.z.number().max(9).gte(0).optional().default(0),
|
|
39
|
-
})
|
|
40
|
-
.optional()
|
|
41
|
-
.default({ reach: 0, dead: 0 }),
|
|
42
|
-
doras: zod_1.z.array(zod_1.z.string()).max(4).optional().default(["3w"]),
|
|
43
|
-
front: unionOfLiterals(Object.keys(constants_1.WIND_MAP))
|
|
44
|
-
.optional()
|
|
45
|
-
.default("1w"),
|
|
46
|
-
})
|
|
47
|
-
.strict();
|
|
48
|
-
var tableInputSchema = windInputsSchema.extend({
|
|
49
|
-
board: boardInputSchema,
|
|
30
|
+
_a));
|
|
31
|
+
var boardInputSchema = (0, valibot_1.strictObject)({
|
|
32
|
+
round: (0, valibot_1.optional)((0, valibot_1.picklist)(Object.keys(constants_1.ROUND_MAP)), "1w1"),
|
|
33
|
+
sticks: (0, valibot_1.optional)((0, valibot_1.strictObject)({
|
|
34
|
+
reach: (0, valibot_1.optional)((0, valibot_1.pipe)((0, valibot_1.number)(), (0, valibot_1.minValue)(0, ""), (0, valibot_1.maxValue)(9, "")), 0),
|
|
35
|
+
dead: (0, valibot_1.optional)((0, valibot_1.pipe)((0, valibot_1.number)(), (0, valibot_1.minValue)(0, ""), (0, valibot_1.maxValue)(9, "")), 0),
|
|
36
|
+
}), { reach: 0, dead: 0 }),
|
|
37
|
+
doras: (0, valibot_1.optional)((0, valibot_1.array)((0, valibot_1.string)()), ["3w"]),
|
|
38
|
+
front: (0, valibot_1.optional)((0, valibot_1.picklist)(Object.keys(constants_1.WIND_MAP)), "1w"),
|
|
50
39
|
});
|
|
40
|
+
var tableInputSchema = (0, valibot_1.strictObject)(__assign(__assign({}, windInputsSchema.entries), { board: boardInputSchema }));
|
|
51
41
|
var parse = function (s) {
|
|
52
42
|
var d = (0, exports.parseTableInput)(s);
|
|
53
43
|
return (0, exports.convertInput)(d);
|
|
@@ -55,11 +45,11 @@ var parse = function (s) {
|
|
|
55
45
|
exports.parse = parse;
|
|
56
46
|
var parseTableInput = function (s) {
|
|
57
47
|
var rawInput = (0, js_yaml_1.load)(s);
|
|
58
|
-
var ret =
|
|
48
|
+
var ret = (0, valibot_1.safeParse)(tableInputSchema, rawInput.table);
|
|
59
49
|
if (!ret.success) {
|
|
60
|
-
throw ret.
|
|
50
|
+
throw ret.issues;
|
|
61
51
|
}
|
|
62
|
-
return ret.
|
|
52
|
+
return ret.output;
|
|
63
53
|
};
|
|
64
54
|
exports.parseTableInput = parseTableInput;
|
|
65
55
|
var convertInput = function (i) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ImageHelper, ImageHelperConfig } from "../
|
|
1
|
+
import { ImageHelper, ImageHelperConfig } from "../image/image";
|
|
2
2
|
import { Svg, G } from "@svgdotjs/svg.js";
|
|
3
3
|
import { FontContext } from "../measure-text/";
|
|
4
|
-
import { ScoreBoardInput, DiscardsInput, HandsInput } from "./
|
|
4
|
+
import { ScoreBoardInput, DiscardsInput, HandsInput } from "./";
|
|
5
5
|
export declare const createTable: (helper: ImageHelper, fontCtx: FontContext, handsProps: HandsInput, discardsProps: DiscardsInput, scoreBoardProps: ScoreBoardInput) => {
|
|
6
6
|
e: G;
|
|
7
7
|
width: number;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.drawTable = exports.createTable = void 0;
|
|
4
|
-
var
|
|
5
|
-
var image_1 = require("../
|
|
4
|
+
var core_1 = require("../core/");
|
|
5
|
+
var image_1 = require("../image/image");
|
|
6
6
|
var svg_js_1 = require("@svgdotjs/svg.js");
|
|
7
|
-
var
|
|
8
|
-
var constants_1 = require("../core/constants");
|
|
7
|
+
var _1 = require("./");
|
|
9
8
|
var splitTiles = function (input) {
|
|
10
9
|
var chunkSize = 6;
|
|
11
10
|
var result = [];
|
|
@@ -46,7 +45,7 @@ var handleDiscard = function (tiles, helper) {
|
|
|
46
45
|
var tiles_1 = chunks[i];
|
|
47
46
|
var posY = i * helper.tileHeight;
|
|
48
47
|
var e = helper
|
|
49
|
-
.createBlockHandDiscard(new
|
|
48
|
+
.createBlockHandDiscard(new core_1.Block(tiles_1, core_1.BLOCK.DISCARD))
|
|
50
49
|
.translate(0, posY);
|
|
51
50
|
g.add(e);
|
|
52
51
|
}
|
|
@@ -239,7 +238,7 @@ var drawTable = function (svg, tableInput, config, fontCtx, params) {
|
|
|
239
238
|
if (params === void 0) { params = { responsive: false }; }
|
|
240
239
|
var helper = new image_1.ImageHelper(config);
|
|
241
240
|
var ctx = fontCtx;
|
|
242
|
-
var _a = (0,
|
|
241
|
+
var _a = (0, _1.parse)(tableInput), discards = _a.discards, hands = _a.hands, scoreBoard = _a.scoreBoard;
|
|
243
242
|
var table = (0, exports.createTable)(helper, ctx, hands, discards, scoreBoard);
|
|
244
243
|
if (!params.responsive)
|
|
245
244
|
svg.size(table.width, table.height);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konoui/mjimage",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "Generates Mahjong tiles in SVG format.",
|
|
5
5
|
"author": "konoui",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github.com/konoui/mjimage",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"keywords": [
|
|
9
10
|
"mahjong"
|
|
10
11
|
],
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"staticOutPath": "svg"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
58
|
+
"@parcel/reporter-bundle-analyzer": "^2.12.0",
|
|
57
59
|
"@parcel/transformer-inline-string": "^2.9.3",
|
|
58
60
|
"@parcel/transformer-typescript-tsc": "^2.9.3",
|
|
59
61
|
"@parcel/validator-typescript": "^2.9.3",
|
|
@@ -63,20 +65,20 @@
|
|
|
63
65
|
"assert": "^2.1.0",
|
|
64
66
|
"buffer": "^6.0.3",
|
|
65
67
|
"jest": "^29.7.0",
|
|
66
|
-
"parcel": "^2.
|
|
68
|
+
"parcel": "^2.12.0",
|
|
67
69
|
"parcel-reporter-static-files-copy": "^1.5.2",
|
|
68
70
|
"process": "^0.11.10",
|
|
69
71
|
"svg-sprite": "^2.0.2",
|
|
70
72
|
"svgdom": "0.1.14",
|
|
71
73
|
"svgo": "^3.0.2",
|
|
72
74
|
"ts-jest": "^29.1.1",
|
|
73
|
-
"typescript": "^5.
|
|
75
|
+
"typescript": "^5.5.4"
|
|
74
76
|
},
|
|
75
77
|
"dependencies": {
|
|
76
78
|
"@svgdotjs/svg.js": "^3.2.4",
|
|
77
79
|
"eventmit": "^2.0.4",
|
|
78
80
|
"js-yaml": "^4.1.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
+
"valibot": "^0.40.0",
|
|
82
|
+
"xstate": "^5.7.0"
|
|
81
83
|
}
|
|
82
84
|
}
|