@logic-pad/core 0.12.4 → 0.12.6
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/assets/logic-core.global.d.ts +13 -49
- package/dist/data/dataHelper.js +1 -0
- package/dist/data/events/eventHelper.js +1 -0
- package/dist/data/grid.d.ts +1 -1
- package/dist/data/primitives.d.ts +2 -6
- package/dist/data/puzzle.d.ts +8 -28
- package/dist/data/puzzle.js +12 -0
- package/dist/data/serializer/allSerializers.js +1 -1
- package/dist/data/serializer/compressor/allCompressors.js +1 -1
- package/dist/data/serializer/serializer_v0.js +4 -4
- package/dist/data/solver/auto/autoSolver.d.ts +1 -1
- package/dist/data/solver/backtrack/backtrackWorker.js +1 -2
- package/dist/data/solver/backtrack/symbols/directionLinker.js +1 -2
- package/dist/data/solver/backtrack/symbols/focus.js +1 -2
- package/dist/data/solver/backtrack/symbols/minesweeper.js +1 -2
- package/dist/data/solver/cspuz/cspuzSolver.js +1 -1
- package/dist/data/solver/eventIteratingSolver.js +1 -1
- package/dist/data/solver/z3/z3Solver.js +1 -1
- package/dist/data/symbols/directionLinkerSymbol.d.ts +1 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +8 -25
|
@@ -106,9 +106,7 @@ declare global {
|
|
|
106
106
|
Right = 'right',
|
|
107
107
|
}
|
|
108
108
|
export declare const DIRECTIONS: readonly Direction[];
|
|
109
|
-
export type DirectionMap<T> =
|
|
110
|
-
[key in Direction]: T;
|
|
111
|
-
};
|
|
109
|
+
export type DirectionMap<T> = Record<Direction, T>;
|
|
112
110
|
export type DirectionToggle = Readonly<DirectionMap<boolean>>;
|
|
113
111
|
export declare function directionToggle(
|
|
114
112
|
...directions: readonly Direction[]
|
|
@@ -129,9 +127,7 @@ declare global {
|
|
|
129
127
|
UpLeft = 'up-left',
|
|
130
128
|
}
|
|
131
129
|
export declare const ORIENTATIONS: readonly Orientation[];
|
|
132
|
-
export type OrientationMap<T> =
|
|
133
|
-
[key in Orientation]: T;
|
|
134
|
-
};
|
|
130
|
+
export type OrientationMap<T> = Record<Orientation, T>;
|
|
135
131
|
export type OrientationToggle = Readonly<OrientationMap<boolean>>;
|
|
136
132
|
export declare function orientationToggle(
|
|
137
133
|
...orientations: readonly Orientation[]
|
|
@@ -1170,11 +1166,7 @@ declare global {
|
|
|
1170
1166
|
* @param color The color of the tile. If undefined, all colors are included.
|
|
1171
1167
|
* @returns The count of tiles that satisfy the given conditions.
|
|
1172
1168
|
*/
|
|
1173
|
-
getTileCount(
|
|
1174
|
-
exists: boolean,
|
|
1175
|
-
fixed?: boolean | undefined,
|
|
1176
|
-
color?: Color | undefined
|
|
1177
|
-
): number;
|
|
1169
|
+
getTileCount(exists: boolean, fixed?: boolean, color?: Color): number;
|
|
1178
1170
|
/**
|
|
1179
1171
|
* Get the count of tiles that satisfy the given conditions for each color.
|
|
1180
1172
|
* @param color The color of the tiles.
|
|
@@ -1425,20 +1417,7 @@ declare global {
|
|
|
1425
1417
|
description: z.ZodString;
|
|
1426
1418
|
difficulty: z.ZodNumber;
|
|
1427
1419
|
},
|
|
1428
|
-
|
|
1429
|
-
z.ZodTypeAny,
|
|
1430
|
-
{
|
|
1431
|
-
description: string;
|
|
1432
|
-
title: string;
|
|
1433
|
-
author: string;
|
|
1434
|
-
difficulty: number;
|
|
1435
|
-
},
|
|
1436
|
-
{
|
|
1437
|
-
description: string;
|
|
1438
|
-
title: string;
|
|
1439
|
-
author: string;
|
|
1440
|
-
difficulty: number;
|
|
1441
|
-
}
|
|
1420
|
+
z.core.$strict
|
|
1442
1421
|
>;
|
|
1443
1422
|
export declare const PuzzleSchema: z.ZodObject<
|
|
1444
1423
|
{
|
|
@@ -1446,27 +1425,10 @@ declare global {
|
|
|
1446
1425
|
author: z.ZodString;
|
|
1447
1426
|
description: z.ZodString;
|
|
1448
1427
|
difficulty: z.ZodNumber;
|
|
1449
|
-
grid: z.
|
|
1450
|
-
solution: z.ZodNullable<z.
|
|
1451
|
-
},
|
|
1452
|
-
'strict',
|
|
1453
|
-
z.ZodTypeAny,
|
|
1454
|
-
{
|
|
1455
|
-
description: string;
|
|
1456
|
-
grid: GridData;
|
|
1457
|
-
title: string;
|
|
1458
|
-
author: string;
|
|
1459
|
-
difficulty: number;
|
|
1460
|
-
solution: GridData | null;
|
|
1428
|
+
grid: z.ZodCustom<GridData, GridData>;
|
|
1429
|
+
solution: z.ZodNullable<z.ZodCustom<GridData, GridData>>;
|
|
1461
1430
|
},
|
|
1462
|
-
|
|
1463
|
-
description: string;
|
|
1464
|
-
grid: GridData;
|
|
1465
|
-
title: string;
|
|
1466
|
-
author: string;
|
|
1467
|
-
difficulty: number;
|
|
1468
|
-
solution: GridData | null;
|
|
1469
|
-
}
|
|
1431
|
+
z.core.$strict
|
|
1470
1432
|
>;
|
|
1471
1433
|
export type PuzzleData = {
|
|
1472
1434
|
/**
|
|
@@ -1485,6 +1447,10 @@ declare global {
|
|
|
1485
1447
|
solution: GridData | null;
|
|
1486
1448
|
};
|
|
1487
1449
|
export type Puzzle = PuzzleMetadata & PuzzleData;
|
|
1450
|
+
/**
|
|
1451
|
+
* Checks if two puzzles are equal.
|
|
1452
|
+
*/
|
|
1453
|
+
export declare function puzzleEquals(a: Puzzle, b: Puzzle): boolean;
|
|
1488
1454
|
/**
|
|
1489
1455
|
* Get the types of a puzzle based on its grid properties. The returned types are ordered by their priority.
|
|
1490
1456
|
* The first type is the most important one.
|
|
@@ -2187,7 +2153,7 @@ declare global {
|
|
|
2187
2153
|
private solveOne;
|
|
2188
2154
|
solve(
|
|
2189
2155
|
grid: GridData,
|
|
2190
|
-
abortSignal?: AbortSignal
|
|
2156
|
+
abortSignal?: AbortSignal
|
|
2191
2157
|
): AsyncGenerator<GridData | null>;
|
|
2192
2158
|
}
|
|
2193
2159
|
export declare abstract class EventIteratingSolver extends Solver {
|
|
@@ -2408,9 +2374,7 @@ declare global {
|
|
|
2408
2374
|
checkGlobal(grid: BTGridData): CheckResult | false;
|
|
2409
2375
|
private buildCheckAndRating;
|
|
2410
2376
|
}
|
|
2411
|
-
export type DirectionLinkerMap =
|
|
2412
|
-
[key in Direction]: Direction;
|
|
2413
|
-
};
|
|
2377
|
+
export type DirectionLinkerMap = Record<Direction, Direction>;
|
|
2414
2378
|
export declare class DirectionLinkerSymbol extends Symbol$1 {
|
|
2415
2379
|
readonly x: number;
|
|
2416
2380
|
readonly y: number;
|
package/dist/data/dataHelper.js
CHANGED
|
@@ -116,6 +116,7 @@ export function resize(array, newSize, defaultValue) {
|
|
|
116
116
|
* @param values The values to compare.
|
|
117
117
|
* @returns Whether all the values are equal.
|
|
118
118
|
*/
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
119
120
|
export function allEqual(...values) {
|
|
120
121
|
return values.every(value => value === values[0]);
|
|
121
122
|
}
|
package/dist/data/grid.d.ts
CHANGED
|
@@ -382,7 +382,7 @@ export default class GridData {
|
|
|
382
382
|
* @param color The color of the tile. If undefined, all colors are included.
|
|
383
383
|
* @returns The count of tiles that satisfy the given conditions.
|
|
384
384
|
*/
|
|
385
|
-
getTileCount(exists: boolean, fixed?: boolean
|
|
385
|
+
getTileCount(exists: boolean, fixed?: boolean, color?: Color): number;
|
|
386
386
|
/**
|
|
387
387
|
* Get the count of tiles that satisfy the given conditions for each color.
|
|
388
388
|
* @param color The color of the tiles.
|
|
@@ -87,9 +87,7 @@ export declare enum Direction {
|
|
|
87
87
|
Right = "right"
|
|
88
88
|
}
|
|
89
89
|
export declare const DIRECTIONS: readonly Direction[];
|
|
90
|
-
export type DirectionMap<T> =
|
|
91
|
-
[key in Direction]: T;
|
|
92
|
-
};
|
|
90
|
+
export type DirectionMap<T> = Record<Direction, T>;
|
|
93
91
|
export type DirectionToggle = Readonly<DirectionMap<boolean>>;
|
|
94
92
|
export declare function directionToggle(...directions: readonly Direction[]): {
|
|
95
93
|
up: boolean;
|
|
@@ -108,9 +106,7 @@ export declare enum Orientation {
|
|
|
108
106
|
UpLeft = "up-left"
|
|
109
107
|
}
|
|
110
108
|
export declare const ORIENTATIONS: readonly Orientation[];
|
|
111
|
-
export type OrientationMap<T> =
|
|
112
|
-
[key in Orientation]: T;
|
|
113
|
-
};
|
|
109
|
+
export type OrientationMap<T> = Record<Orientation, T>;
|
|
114
110
|
export type OrientationToggle = Readonly<OrientationMap<boolean>>;
|
|
115
111
|
export declare function orientationToggle(...orientations: readonly Orientation[]): {
|
|
116
112
|
up: boolean;
|
package/dist/data/puzzle.d.ts
CHANGED
|
@@ -26,39 +26,15 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
26
26
|
author: z.ZodString;
|
|
27
27
|
description: z.ZodString;
|
|
28
28
|
difficulty: z.ZodNumber;
|
|
29
|
-
},
|
|
30
|
-
description: string;
|
|
31
|
-
title: string;
|
|
32
|
-
author: string;
|
|
33
|
-
difficulty: number;
|
|
34
|
-
}, {
|
|
35
|
-
description: string;
|
|
36
|
-
title: string;
|
|
37
|
-
author: string;
|
|
38
|
-
difficulty: number;
|
|
39
|
-
}>;
|
|
29
|
+
}, z.core.$strict>;
|
|
40
30
|
export declare const PuzzleSchema: z.ZodObject<{
|
|
41
31
|
title: z.ZodString;
|
|
42
32
|
author: z.ZodString;
|
|
43
33
|
description: z.ZodString;
|
|
44
34
|
difficulty: z.ZodNumber;
|
|
45
|
-
grid: z.
|
|
46
|
-
solution: z.ZodNullable<z.
|
|
47
|
-
},
|
|
48
|
-
description: string;
|
|
49
|
-
grid: GridData;
|
|
50
|
-
title: string;
|
|
51
|
-
author: string;
|
|
52
|
-
difficulty: number;
|
|
53
|
-
solution: GridData | null;
|
|
54
|
-
}, {
|
|
55
|
-
description: string;
|
|
56
|
-
grid: GridData;
|
|
57
|
-
title: string;
|
|
58
|
-
author: string;
|
|
59
|
-
difficulty: number;
|
|
60
|
-
solution: GridData | null;
|
|
61
|
-
}>;
|
|
35
|
+
grid: z.ZodCustom<GridData, GridData>;
|
|
36
|
+
solution: z.ZodNullable<z.ZodCustom<GridData, GridData>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
62
38
|
export type PuzzleData = {
|
|
63
39
|
/**
|
|
64
40
|
* The grid of the puzzle. (required)
|
|
@@ -76,6 +52,10 @@ export type PuzzleData = {
|
|
|
76
52
|
solution: GridData | null;
|
|
77
53
|
};
|
|
78
54
|
export type Puzzle = PuzzleMetadata & PuzzleData;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if two puzzles are equal.
|
|
57
|
+
*/
|
|
58
|
+
export declare function puzzleEquals(a: Puzzle, b: Puzzle): boolean;
|
|
79
59
|
/**
|
|
80
60
|
* Get the types of a puzzle based on its grid properties. The returned types are ordered by their priority.
|
|
81
61
|
* The first type is the most important one.
|
package/dist/data/puzzle.js
CHANGED
|
@@ -19,6 +19,18 @@ export const PuzzleSchema = z
|
|
|
19
19
|
solution: z.instanceof(GridData).nullable(),
|
|
20
20
|
})
|
|
21
21
|
.strict();
|
|
22
|
+
/**
|
|
23
|
+
* Checks if two puzzles are equal.
|
|
24
|
+
*/
|
|
25
|
+
export function puzzleEquals(a, b) {
|
|
26
|
+
return (a.title === b.title &&
|
|
27
|
+
a.author === b.author &&
|
|
28
|
+
a.description === b.description &&
|
|
29
|
+
a.difficulty === b.difficulty &&
|
|
30
|
+
a.grid.equals(b.grid) &&
|
|
31
|
+
((a.solution === null && b.solution === null) ||
|
|
32
|
+
(!!a.solution && !!b.solution && a.solution.equals(b.solution))));
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* Get the types of a puzzle based on its grid properties. The returned types are ordered by their priority.
|
|
24
36
|
* The first type is the most important one.
|
|
@@ -6,7 +6,7 @@ function register(prototype) {
|
|
|
6
6
|
let defaultSerializer;
|
|
7
7
|
register((defaultSerializer = new SerializerV0()));
|
|
8
8
|
function selectSerializer(input) {
|
|
9
|
-
const match =
|
|
9
|
+
const match = /^(\d+)_/.exec(input);
|
|
10
10
|
const version = match ? parseInt(match[1]) : 0;
|
|
11
11
|
const serializer = allSerializers.get(version);
|
|
12
12
|
if (serializer) {
|
|
@@ -24,7 +24,7 @@ class MasterCompressor extends CompressorBase {
|
|
|
24
24
|
return minBy(compressed, c => encodeURIComponent(c).length) ?? '';
|
|
25
25
|
}
|
|
26
26
|
async decompress(input) {
|
|
27
|
-
const match =
|
|
27
|
+
const match = /^([^_]+?)_(.+)$/.exec(input);
|
|
28
28
|
let compressorId;
|
|
29
29
|
let compressed;
|
|
30
30
|
if (match) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import GridData from '../grid.js';
|
|
2
2
|
import GridConnections from '../gridConnections.js';
|
|
3
3
|
import TileData from '../tile.js';
|
|
4
|
-
import { ConfigType } from '../config.js';
|
|
4
|
+
import { ConfigType, } from '../config.js';
|
|
5
5
|
import { Color, DIRECTIONS, ORIENTATIONS, Orientation, directionToggle, orientationToggle, } from '../primitives.js';
|
|
6
6
|
import { array, escape, unescape } from '../dataHelper.js';
|
|
7
7
|
import { allRules } from '../rules/index.js';
|
|
@@ -83,7 +83,7 @@ export default class SerializerV0 extends SerializerBase {
|
|
|
83
83
|
break;
|
|
84
84
|
case 'r':
|
|
85
85
|
rows.push(...value.split(',').map(row => {
|
|
86
|
-
const match =
|
|
86
|
+
const match = /^v([\d.]*?)n(.*)$/.exec(row);
|
|
87
87
|
if (!match)
|
|
88
88
|
return new Row(null, null);
|
|
89
89
|
const [, velocity, note] = match;
|
|
@@ -108,7 +108,7 @@ export default class SerializerV0 extends SerializerBase {
|
|
|
108
108
|
case ConfigType.Orientation:
|
|
109
109
|
return (config.field +
|
|
110
110
|
'=' +
|
|
111
|
-
|
|
111
|
+
instruction[config.field]);
|
|
112
112
|
case ConfigType.NullableBoolean:
|
|
113
113
|
return (config.field +
|
|
114
114
|
'=' +
|
|
@@ -139,7 +139,7 @@ export default class SerializerV0 extends SerializerBase {
|
|
|
139
139
|
case ConfigType.Icon:
|
|
140
140
|
return (config.field +
|
|
141
141
|
'=' +
|
|
142
|
-
escape(
|
|
142
|
+
escape(instruction[config.field]));
|
|
143
143
|
case ConfigType.NullableNote:
|
|
144
144
|
return (config.field +
|
|
145
145
|
'=' +
|
|
@@ -13,5 +13,5 @@ export default class AutoSolver extends Solver {
|
|
|
13
13
|
private fixGrid;
|
|
14
14
|
private solveWithProgress;
|
|
15
15
|
private solveOne;
|
|
16
|
-
solve(grid: GridData, abortSignal?: AbortSignal
|
|
16
|
+
solve(grid: GridData, abortSignal?: AbortSignal): AsyncGenerator<GridData | null>;
|
|
17
17
|
}
|
|
@@ -38,8 +38,7 @@ export default class DirectionLinkerBTModule extends BTModule {
|
|
|
38
38
|
return [{ x: this.instr.x, y: this.instr.y }];
|
|
39
39
|
}
|
|
40
40
|
checkGlobal(grid) {
|
|
41
|
-
|
|
42
|
-
this.initialPositions = this.getInitialPositions();
|
|
41
|
+
this.initialPositions ?? (this.initialPositions = this.getInitialPositions());
|
|
43
42
|
const tilesNeedCheck = IntArray2D.create(grid.width, grid.height);
|
|
44
43
|
const ratings = [];
|
|
45
44
|
for (const pos of this.initialPositions) {
|
|
@@ -37,8 +37,7 @@ export default class FocusBTModule extends BTModule {
|
|
|
37
37
|
}
|
|
38
38
|
if (same > this.instr.number || same + gray < this.instr.number)
|
|
39
39
|
return false;
|
|
40
|
-
|
|
41
|
-
this.cachedCheckResult = this.buildCheckAndRating(grid);
|
|
40
|
+
this.cachedCheckResult ?? (this.cachedCheckResult = this.buildCheckAndRating(grid));
|
|
42
41
|
return this.cachedCheckResult;
|
|
43
42
|
}
|
|
44
43
|
buildCheckAndRating(grid) {
|
|
@@ -35,8 +35,7 @@ export default class MinesweeperBTModule extends BTModule {
|
|
|
35
35
|
}
|
|
36
36
|
if (opposite > this.instr.number || opposite + gray < this.instr.number)
|
|
37
37
|
return false;
|
|
38
|
-
|
|
39
|
-
this.cachedCheckResult = this.buildCheckAndRating(grid);
|
|
38
|
+
this.cachedCheckResult ?? (this.cachedCheckResult = this.buildCheckAndRating(grid));
|
|
40
39
|
return this.cachedCheckResult;
|
|
41
40
|
}
|
|
42
41
|
buildCheckAndRating(grid) {
|
|
@@ -2,9 +2,7 @@ import { AnyConfig } from '../config.js';
|
|
|
2
2
|
import GridData from '../grid.js';
|
|
3
3
|
import { Direction, State } from '../primitives.js';
|
|
4
4
|
import Symbol from './symbol.js';
|
|
5
|
-
export type DirectionLinkerMap =
|
|
6
|
-
[key in Direction]: Direction;
|
|
7
|
-
};
|
|
5
|
+
export type DirectionLinkerMap = Record<Direction, Direction>;
|
|
8
6
|
export default class DirectionLinkerSymbol extends Symbol {
|
|
9
7
|
readonly x: number;
|
|
10
8
|
readonly y: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import GridConnections from './data/gridConnections.js';
|
|
|
14
14
|
import GridZones from './data/gridZones.js';
|
|
15
15
|
import Instruction from './data/instruction.js';
|
|
16
16
|
import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle } from './data/primitives.js';
|
|
17
|
-
import { MetadataSchema, PuzzleSchema, getPuzzleTypes, validatePuzzleChecklist } from './data/puzzle.js';
|
|
17
|
+
import { MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist } from './data/puzzle.js';
|
|
18
18
|
import BanPatternRule from './data/rules/banPatternRule.js';
|
|
19
19
|
import CellCountPerZoneRule from './data/rules/cellCountPerZoneRule.js';
|
|
20
20
|
import CellCountRule from './data/rules/cellCountRule.js';
|
|
@@ -108,4 +108,4 @@ import ViewpointSymbol from './data/symbols/viewpointSymbol.js';
|
|
|
108
108
|
import TileData from './data/tile.js';
|
|
109
109
|
import TileConnections from './data/tileConnections.js';
|
|
110
110
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
111
|
-
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ContainsShapeRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
|
|
111
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ContainsShapeRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import GridConnections from './data/gridConnections.js';
|
|
|
17
17
|
import GridZones from './data/gridZones.js';
|
|
18
18
|
import Instruction from './data/instruction.js';
|
|
19
19
|
import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle } from './data/primitives.js';
|
|
20
|
-
import { MetadataSchema, PuzzleSchema, getPuzzleTypes, validatePuzzleChecklist } from './data/puzzle.js';
|
|
20
|
+
import { MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist } from './data/puzzle.js';
|
|
21
21
|
import BanPatternRule from './data/rules/banPatternRule.js';
|
|
22
22
|
import CellCountPerZoneRule from './data/rules/cellCountPerZoneRule.js';
|
|
23
23
|
import CellCountRule from './data/rules/cellCountRule.js';
|
|
@@ -111,4 +111,4 @@ import ViewpointSymbol from './data/symbols/viewpointSymbol.js';
|
|
|
111
111
|
import TileData from './data/tile.js';
|
|
112
112
|
import TileConnections from './data/tileConnections.js';
|
|
113
113
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
114
|
-
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ContainsShapeRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
|
|
114
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ContainsShapeRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logic-pad/core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -51,38 +51,21 @@
|
|
|
51
51
|
"bun": ">=1.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"base64-arraybuffer": "^1.0.2",
|
|
55
54
|
"compression-streams-polyfill": "^0.1.7",
|
|
56
|
-
"dedent": "^1.5.3",
|
|
57
55
|
"event-iterator": "^2.0.0",
|
|
58
|
-
"events": "^3.3.0",
|
|
59
56
|
"grilops": "^0.1.2",
|
|
60
|
-
"lodash": "^4.17.21",
|
|
61
57
|
"logic-pad-solver-core": "^0.1.2",
|
|
62
58
|
"z3-solver": "^4.13.0",
|
|
63
|
-
"zod": "^
|
|
59
|
+
"zod": "^4.0.17"
|
|
64
60
|
},
|
|
65
61
|
"devDependencies": {
|
|
66
|
-
"@types/bun": "^1.
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/lodash": "^4.17.0",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
70
|
-
"@typescript-eslint/parser": "^7.1.0",
|
|
62
|
+
"@types/bun": "^1.2.20",
|
|
63
|
+
"@types/glob": "^9.0.0",
|
|
71
64
|
"dts-bundle-generator": "^9.5.1",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
77
|
-
"eslint-plugin-import": "^2.29.1",
|
|
78
|
-
"eslint-plugin-n": "^16.6.2",
|
|
79
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
80
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
81
|
-
"eslint-plugin-standard": "^5.0.0",
|
|
82
|
-
"fast-glob": "^3.3.2",
|
|
83
|
-
"prettier": "^3.2.5",
|
|
84
|
-
"rimraf": "^5.0.5",
|
|
85
|
-
"typescript": "^5.4.5"
|
|
65
|
+
"fast-glob": "^3.3.3",
|
|
66
|
+
"prettier": "^3.6.2",
|
|
67
|
+
"rimraf": "^6.0.1",
|
|
68
|
+
"typescript": "^5.9.2"
|
|
86
69
|
},
|
|
87
70
|
"trustedDependencies": [
|
|
88
71
|
"esbuild"
|