pdf-factory 0.8.21 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"consolationDraw.d.ts","sourceRoot":"","sources":["../../src/renderers/consolationDraw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,cAAc,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;CAC3B,GAAG,oBAAoB,EAAE,CA6EzB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,KAAK,EACV,UAAU,EAAE,oBAAoB,EAAE,EAClC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,GACnB,IAAI,CAsCN"}
1
+ {"version":3,"file":"consolationDraw.d.ts","sourceRoot":"","sources":["../../src/renderers/consolationDraw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,cAAc,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;CAC3B,GAAG,oBAAoB,EAAE,CA8EzB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,KAAK,EACV,UAAU,EAAE,oBAAoB,EAAE,EAClC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,GACnB,IAAI,CAsCN"}
@@ -1 +1 @@
1
- {"version":3,"file":"drawSplitter.d.ts","sourceRoot":"","sources":["../../src/renderers/drawSplitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAQD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAE,eAA+B,GAAG,WAAW,EAAE,CA8BpG"}
1
+ {"version":3,"file":"drawSplitter.d.ts","sourceRoot":"","sources":["../../src/renderers/drawSplitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG/E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAQD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAE,eAA+B,GAAG,WAAW,EAAE,CA8BpG"}
@@ -1 +1 @@
1
- {"version":3,"file":"mirroredDraw.d.ts","sourceRoot":"","sources":["../../src/renderers/mirroredDraw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAyB,MAAM,yBAAyB,CAAC;AAc/E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,GACnB,IAAI,CAmJN"}
1
+ {"version":3,"file":"mirroredDraw.d.ts","sourceRoot":"","sources":["../../src/renderers/mirroredDraw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAyB,MAAM,yBAAyB,CAAC;AAe/E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,GACnB,IAAI,CAyKN"}
@@ -0,0 +1,50 @@
1
+ import { DrawMatchUp } from '../core/extractDrawData';
2
+ /**
3
+ * Which partition a matchUp belongs to when it holds no drawPosition.
4
+ *
5
+ * `Array.prototype.every` returns `true` for an empty array, so a matchUp whose `drawPositions` is
6
+ * `[]` satisfies EVERY positional predicate it is offered. In `mirroredDraw` that put it in both
7
+ * halves; in `drawSplitter` it put it in every page segment. Neither is a throw — the symptom is a
8
+ * duplicated or misplaced empty bracket, which is why it went unnoticed.
9
+ *
10
+ * `[]` is not an edge case. `extractDrawData`, `drawsDataToDrawData` and `extractCompassData` all
11
+ * normalise an absent `drawPositions` to `[]`, and an absent array is the ordinary stored shape of
12
+ * any matchUp nobody has reached yet. Measured on freshly generated 16 draws with every position
13
+ * filled: SINGLE_ELIMINATION 7 of 15, DOUBLE_ELIMINATION 11 of 31, FEED_IN_CHAMPIONSHIP_TO_SF 10 of
14
+ * 28, COMPASS 12 of 32. On an unplayed or partly played draw — which is exactly when a draw sheet
15
+ * is printed — roughly a third of the matchUps take every branch.
16
+ *
17
+ * ## Where such a matchUp belongs
18
+ *
19
+ * It cannot be placed by position, so it is placed by ROUND POSITION. In an elimination round the
20
+ * first half of the roundPositions feed from the first half of the draw: in a 16 draw, round 1
21
+ * roundPositions 1-4 hold positions 1-8 and 5-8 hold 9-16; round 2 roundPositions 1-2 hold 1-8.
22
+ * That relationship is what the layout already draws.
23
+ *
24
+ * ## When it belongs to NO partition
25
+ *
26
+ * A round holding fewer matchUps than there are partitions spans them — the final of a 16 draw
27
+ * covers both halves — and such a matchUp is placed in none. That is not a new rule: a PLAYED final
28
+ * has drawPositions on both sides of the split and is already excluded by the existing predicates,
29
+ * so excluding the unplayed one keeps the two consistent. Returning `undefined` rather than a
30
+ * partition is what says so.
31
+ */
32
+ export declare function positionlessPartitionIndex({ partitionCount, matchUps, matchUp, }: {
33
+ matchUps: DrawMatchUp[];
34
+ matchUp: DrawMatchUp;
35
+ partitionCount: number;
36
+ }): number | undefined;
37
+ /**
38
+ * Does `matchUp` belong in the partition at `partitionIndex`?
39
+ *
40
+ * Positional matchUps keep the caller's own predicate — this changes nothing for them. Only the
41
+ * position-less ones are routed by roundPosition.
42
+ */
43
+ export declare function belongsInPartition({ positionPredicate, partitionIndex, partitionCount, matchUps, matchUp, }: {
44
+ positionPredicate: (drawPosition: number) => boolean;
45
+ matchUps: DrawMatchUp[];
46
+ matchUp: DrawMatchUp;
47
+ partitionIndex: number;
48
+ partitionCount: number;
49
+ }): boolean;
50
+ //# sourceMappingURL=positionlessPlacement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionlessPlacement.d.ts","sourceRoot":"","sources":["../../src/renderers/positionlessPlacement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,cAAc,EACd,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,GAAG,SAAS,CAWrB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,QAAQ,EACR,OAAO,GACR,EAAE;IACD,iBAAiB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAIV"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pdf-factory",
3
- "packageManager": "pnpm@11.22.0",
4
- "version": "0.8.21",
3
+ "packageManager": "pnpm@12.5.1",
4
+ "version": "1.0.0",
5
5
  "description": "Generate tournament PDFs from TODS data — draw sheets, schedules, player lists, court cards",
6
6
  "license": "MIT",
7
7
  "author": "CourtHive",
@@ -96,27 +96,27 @@
96
96
  "@types/pngjs": "^6.0.5",
97
97
  "@typescript-eslint/eslint-plugin": "^8.58.0",
98
98
  "@typescript-eslint/parser": "^8.58.0",
99
- "@vitest/coverage-v8": "^4.1.2",
100
- "@vitest/ui": "^4.1.2",
99
+ "@vitest/coverage-v8": "^5.0.0",
100
+ "@vitest/ui": "^5.0.0",
101
101
  "cz-git": "^1.12.0",
102
102
  "eslint": "^10.1.0",
103
103
  "eslint-plugin-sonarjs": "^4.0.2",
104
104
  "globals": "^17.4.0",
105
105
  "husky": "^9.1.7",
106
106
  "lint-staged": "^17.0.0",
107
- "pdf-to-img": "^6.0.0",
107
+ "pdf-to-img": "^7.0.0",
108
108
  "pdf2json": "^4.0.2",
109
109
  "pixelmatch": "^7.1.0",
110
110
  "pngjs": "^7.0.0",
111
111
  "prettier": "^3.8.1",
112
112
  "storybook": "^10.2.17",
113
- "tods-competition-factory": "6.33.0",
113
+ "tods-competition-factory": "7.0.0",
114
114
  "typescript": "^6.0.2",
115
115
  "unplugin-dts": "^1.0.0",
116
116
  "vite": "^8.0.3",
117
- "vitest": "^4.1.2"
117
+ "vitest": "^5.0.0"
118
118
  },
119
119
  "peerDependencies": {
120
- "tods-competition-factory": "^6.0.0"
120
+ "tods-competition-factory": "^7.0.0"
121
121
  }
122
122
  }