@logic-pad/core 0.22.1 → 0.23.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/assets/logic-core.global.d.ts +33 -13
- package/dist/data/events/onSymbolMerge.d.ts +10 -0
- package/dist/data/events/onSymbolMerge.js +4 -0
- package/dist/data/symbols/customSymbol.d.ts +4 -2
- package/dist/data/symbols/customSymbol.js +7 -2
- package/dist/data/symbols/focusSymbol.d.ts +12 -4
- package/dist/data/symbols/focusSymbol.js +65 -11
- package/dist/data/symbols/myopiaSymbol.d.ts +4 -2
- package/dist/data/symbols/myopiaSymbol.js +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/data/symbols/multiEntrySymbol.d.ts +0 -11
- package/dist/data/symbols/multiEntrySymbol.js +0 -14
|
@@ -1448,6 +1448,16 @@ declare global {
|
|
|
1448
1448
|
export declare function handlesSymbolDisplay<T extends Instruction>(
|
|
1449
1449
|
val: T
|
|
1450
1450
|
): val is T & SymbolDisplayHandler;
|
|
1451
|
+
export interface SymbolMergeHandler {
|
|
1452
|
+
/**
|
|
1453
|
+
* Determines if the description of two symbols can be merged when displayed in the UI.
|
|
1454
|
+
* @param other The other symbol to compare against.
|
|
1455
|
+
*/
|
|
1456
|
+
descriptionEquals(other: Symbol$1): boolean;
|
|
1457
|
+
}
|
|
1458
|
+
export declare function handlesSymbolMerge<T extends Instruction>(
|
|
1459
|
+
val: T
|
|
1460
|
+
): val is T & SymbolMergeHandler;
|
|
1451
1461
|
export interface SymbolValidationHandler {
|
|
1452
1462
|
/**
|
|
1453
1463
|
* Overrides the validation of symbols.
|
|
@@ -2641,17 +2651,23 @@ declare global {
|
|
|
2641
2651
|
y: number
|
|
2642
2652
|
): Position$1 | null;
|
|
2643
2653
|
}
|
|
2644
|
-
export declare class FocusSymbol
|
|
2645
|
-
|
|
2654
|
+
export declare class FocusSymbol
|
|
2655
|
+
extends NumberSymbol
|
|
2656
|
+
implements SymbolMergeHandler
|
|
2657
|
+
{
|
|
2658
|
+
readonly deadEnd: boolean;
|
|
2659
|
+
get title(): string;
|
|
2646
2660
|
private static readonly CONFIGS;
|
|
2647
2661
|
private static readonly EXAMPLE_GRID;
|
|
2662
|
+
private static readonly EXAMPLE_GRID_DEAD_END;
|
|
2648
2663
|
/**
|
|
2649
2664
|
* **Focus Numbers count directly adjacent cells of the same color**
|
|
2650
2665
|
* @param x - The x-coordinate of the symbol.
|
|
2651
2666
|
* @param y - The y-coordinate of the symbol.
|
|
2667
|
+
* @param deadEnd - Whether this Focus Number is a Dead End.
|
|
2652
2668
|
* @param number - The focus number.
|
|
2653
2669
|
*/
|
|
2654
|
-
constructor(x: number, y: number, number: number);
|
|
2670
|
+
constructor(x: number, y: number, deadEnd: boolean, number: number);
|
|
2655
2671
|
get id(): string;
|
|
2656
2672
|
get placementStep(): number;
|
|
2657
2673
|
get explanation(): string;
|
|
@@ -2662,16 +2678,20 @@ declare global {
|
|
|
2662
2678
|
completed: number;
|
|
2663
2679
|
possible: number;
|
|
2664
2680
|
};
|
|
2681
|
+
descriptionEquals(other: Symbol$1): boolean;
|
|
2665
2682
|
copyWith({
|
|
2666
2683
|
x,
|
|
2667
2684
|
y,
|
|
2685
|
+
deadEnd,
|
|
2668
2686
|
number,
|
|
2669
2687
|
}: {
|
|
2670
2688
|
x?: number;
|
|
2671
2689
|
y?: number;
|
|
2690
|
+
deadEnd?: boolean;
|
|
2672
2691
|
number?: number;
|
|
2673
2692
|
}): this;
|
|
2674
2693
|
withNumber(number: number): this;
|
|
2694
|
+
withDeadEnd(deadEnd: boolean): this;
|
|
2675
2695
|
}
|
|
2676
2696
|
export declare class FocusBTModule extends BTModule {
|
|
2677
2697
|
instr: FocusSymbol;
|
|
@@ -2826,15 +2846,10 @@ declare global {
|
|
|
2826
2846
|
checkGlobal(grid: BTGridData): CheckResult | false;
|
|
2827
2847
|
private buildCheckAndRating;
|
|
2828
2848
|
}
|
|
2829
|
-
export declare
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
* @returns Whether the two MultiEntrySymbols have the same description.
|
|
2834
|
-
*/
|
|
2835
|
-
descriptionEquals(other: Instruction): boolean;
|
|
2836
|
-
}
|
|
2837
|
-
export declare class MyopiaSymbol extends MultiEntrySymbol {
|
|
2849
|
+
export declare class MyopiaSymbol
|
|
2850
|
+
extends Symbol$1
|
|
2851
|
+
implements SymbolMergeHandler
|
|
2852
|
+
{
|
|
2838
2853
|
readonly diagonals: boolean;
|
|
2839
2854
|
readonly directions: OrientationToggle;
|
|
2840
2855
|
get title(): 'Framed Myopia Arrow' | 'Myopia Arrow';
|
|
@@ -2860,6 +2875,7 @@ declare global {
|
|
|
2860
2875
|
get configs(): readonly AnyConfig[] | null;
|
|
2861
2876
|
createExampleGrid(): GridData;
|
|
2862
2877
|
validateSymbol(grid: GridData): State;
|
|
2878
|
+
descriptionEquals(other: Symbol$1): boolean;
|
|
2863
2879
|
copyWith({
|
|
2864
2880
|
x,
|
|
2865
2881
|
y,
|
|
@@ -3030,7 +3046,10 @@ declare global {
|
|
|
3030
3046
|
isInstructionSupported(instructionId: string): boolean;
|
|
3031
3047
|
isGridSupported(grid: GridData): boolean;
|
|
3032
3048
|
}
|
|
3033
|
-
export declare abstract class CustomSymbol
|
|
3049
|
+
export declare abstract class CustomSymbol
|
|
3050
|
+
extends Symbol$1
|
|
3051
|
+
implements SymbolMergeHandler
|
|
3052
|
+
{
|
|
3034
3053
|
readonly description: string;
|
|
3035
3054
|
readonly grid: GridData;
|
|
3036
3055
|
/**
|
|
@@ -3046,6 +3065,7 @@ declare global {
|
|
|
3046
3065
|
createExampleGrid(): GridData;
|
|
3047
3066
|
validateSymbol(_grid: GridData): State;
|
|
3048
3067
|
get validateWithSolution(): boolean;
|
|
3068
|
+
descriptionEquals(other: Symbol$1): boolean;
|
|
3049
3069
|
withDescription(description: string): this;
|
|
3050
3070
|
withGrid(grid: GridData): this;
|
|
3051
3071
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Instruction from '../instruction.js';
|
|
2
|
+
import Symbol from '../symbols/symbol.js';
|
|
3
|
+
export interface SymbolMergeHandler {
|
|
4
|
+
/**
|
|
5
|
+
* Determines if the description of two symbols can be merged when displayed in the UI.
|
|
6
|
+
* @param other The other symbol to compare against.
|
|
7
|
+
*/
|
|
8
|
+
descriptionEquals(other: Symbol): boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function handlesSymbolMerge<T extends Instruction>(val: T): val is T & SymbolMergeHandler;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { SymbolMergeHandler } from '../events/onSymbolMerge.js';
|
|
1
2
|
import GridData from '../grid.js';
|
|
2
3
|
import { State } from '../primitives.js';
|
|
3
|
-
import
|
|
4
|
-
export default abstract class CustomSymbol extends
|
|
4
|
+
import Symbol from './symbol.js';
|
|
5
|
+
export default abstract class CustomSymbol extends Symbol implements SymbolMergeHandler {
|
|
5
6
|
readonly description: string;
|
|
6
7
|
readonly grid: GridData;
|
|
7
8
|
/**
|
|
@@ -17,6 +18,7 @@ export default abstract class CustomSymbol extends MultiEntrySymbol {
|
|
|
17
18
|
createExampleGrid(): GridData;
|
|
18
19
|
validateSymbol(_grid: GridData): State;
|
|
19
20
|
get validateWithSolution(): boolean;
|
|
21
|
+
descriptionEquals(other: Symbol): boolean;
|
|
20
22
|
withDescription(description: string): this;
|
|
21
23
|
withGrid(grid: GridData): this;
|
|
22
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { State } from '../primitives.js';
|
|
2
|
-
import
|
|
3
|
-
export default class CustomSymbol extends
|
|
2
|
+
import Symbol from './symbol.js';
|
|
3
|
+
export default class CustomSymbol extends Symbol {
|
|
4
4
|
/**
|
|
5
5
|
* **A custom symbol**
|
|
6
6
|
*
|
|
@@ -38,6 +38,11 @@ export default class CustomSymbol extends MultiEntrySymbol {
|
|
|
38
38
|
get validateWithSolution() {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
|
+
descriptionEquals(other) {
|
|
42
|
+
return (this.id === other.id &&
|
|
43
|
+
this.explanation === other.explanation &&
|
|
44
|
+
this.createExampleGrid().equals(other.createExampleGrid()));
|
|
45
|
+
}
|
|
41
46
|
withDescription(description) {
|
|
42
47
|
return this.copyWith({ description });
|
|
43
48
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { AnyConfig } from '../config.js';
|
|
2
|
+
import { SymbolMergeHandler } from '../events/onSymbolMerge.js';
|
|
2
3
|
import GridData from '../grid.js';
|
|
3
4
|
import NumberSymbol from './numberSymbol.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import Symbol from './symbol.js';
|
|
6
|
+
export default class FocusSymbol extends NumberSymbol implements SymbolMergeHandler {
|
|
7
|
+
readonly deadEnd: boolean;
|
|
8
|
+
get title(): string;
|
|
6
9
|
private static readonly CONFIGS;
|
|
7
10
|
private static readonly EXAMPLE_GRID;
|
|
11
|
+
private static readonly EXAMPLE_GRID_DEAD_END;
|
|
8
12
|
/**
|
|
9
13
|
* **Focus Numbers count directly adjacent cells of the same color**
|
|
10
14
|
* @param x - The x-coordinate of the symbol.
|
|
11
15
|
* @param y - The y-coordinate of the symbol.
|
|
16
|
+
* @param deadEnd - Whether this Focus Number is a Dead End.
|
|
12
17
|
* @param number - The focus number.
|
|
13
18
|
*/
|
|
14
|
-
constructor(x: number, y: number, number: number);
|
|
19
|
+
constructor(x: number, y: number, deadEnd: boolean, number: number);
|
|
15
20
|
get id(): string;
|
|
16
21
|
get placementStep(): number;
|
|
17
22
|
get explanation(): string;
|
|
@@ -22,11 +27,14 @@ export default class FocusSymbol extends NumberSymbol {
|
|
|
22
27
|
completed: number;
|
|
23
28
|
possible: number;
|
|
24
29
|
};
|
|
25
|
-
|
|
30
|
+
descriptionEquals(other: Symbol): boolean;
|
|
31
|
+
copyWith({ x, y, deadEnd, number, }: {
|
|
26
32
|
x?: number;
|
|
27
33
|
y?: number;
|
|
34
|
+
deadEnd?: boolean;
|
|
28
35
|
number?: number;
|
|
29
36
|
}): this;
|
|
30
37
|
withNumber(number: number): this;
|
|
38
|
+
withDeadEnd(deadEnd: boolean): this;
|
|
31
39
|
}
|
|
32
40
|
export declare const instance: FocusSymbol;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ConfigType } from '../config.js';
|
|
2
2
|
import GridData from '../grid.js';
|
|
3
3
|
import { Color } from '../primitives.js';
|
|
4
|
+
import AreaNumberSymbol from './areaNumberSymbol.js';
|
|
5
|
+
import LetterSymbol from './letterSymbol.js';
|
|
4
6
|
import NumberSymbol from './numberSymbol.js';
|
|
5
7
|
const OFFSETS = [
|
|
6
8
|
[0, -1],
|
|
@@ -9,20 +11,33 @@ const OFFSETS = [
|
|
|
9
11
|
[-1, 0],
|
|
10
12
|
];
|
|
11
13
|
class FocusSymbol extends NumberSymbol {
|
|
14
|
+
get title() {
|
|
15
|
+
if (this.deadEnd) {
|
|
16
|
+
return 'Dead End';
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return 'Focus Number';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
12
22
|
/**
|
|
13
23
|
* **Focus Numbers count directly adjacent cells of the same color**
|
|
14
24
|
* @param x - The x-coordinate of the symbol.
|
|
15
25
|
* @param y - The y-coordinate of the symbol.
|
|
26
|
+
* @param deadEnd - Whether this Focus Number is a Dead End.
|
|
16
27
|
* @param number - The focus number.
|
|
17
28
|
*/
|
|
18
|
-
constructor(x, y, number) {
|
|
29
|
+
constructor(x, y, deadEnd, number) {
|
|
30
|
+
if (deadEnd) {
|
|
31
|
+
number = 1;
|
|
32
|
+
}
|
|
19
33
|
super(x, y, number);
|
|
20
|
-
Object.defineProperty(this, "
|
|
34
|
+
Object.defineProperty(this, "deadEnd", {
|
|
21
35
|
enumerable: true,
|
|
22
36
|
configurable: true,
|
|
23
37
|
writable: true,
|
|
24
|
-
value:
|
|
38
|
+
value: deadEnd
|
|
25
39
|
});
|
|
40
|
+
this.deadEnd = deadEnd;
|
|
26
41
|
}
|
|
27
42
|
get id() {
|
|
28
43
|
return `focus`;
|
|
@@ -31,13 +46,23 @@ class FocusSymbol extends NumberSymbol {
|
|
|
31
46
|
return 1;
|
|
32
47
|
}
|
|
33
48
|
get explanation() {
|
|
34
|
-
|
|
49
|
+
if (this.deadEnd) {
|
|
50
|
+
return `*Dead Ends* connect to one adjacent cell of the same color`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return '*Focus Numbers* count directly adjacent cells of the same color';
|
|
54
|
+
}
|
|
35
55
|
}
|
|
36
56
|
get configs() {
|
|
37
57
|
return FocusSymbol.CONFIGS;
|
|
38
58
|
}
|
|
39
59
|
createExampleGrid() {
|
|
40
|
-
|
|
60
|
+
if (this.deadEnd) {
|
|
61
|
+
return FocusSymbol.EXAMPLE_GRID_DEAD_END;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return FocusSymbol.EXAMPLE_GRID;
|
|
65
|
+
}
|
|
41
66
|
}
|
|
42
67
|
countForColor(grid, color) {
|
|
43
68
|
let gray = 0;
|
|
@@ -76,12 +101,18 @@ class FocusSymbol extends NumberSymbol {
|
|
|
76
101
|
}
|
|
77
102
|
return this.countForColor(grid, color);
|
|
78
103
|
}
|
|
79
|
-
|
|
80
|
-
return
|
|
104
|
+
descriptionEquals(other) {
|
|
105
|
+
return this.id === other.id && this.explanation === other.explanation;
|
|
106
|
+
}
|
|
107
|
+
copyWith({ x, y, deadEnd, number, }) {
|
|
108
|
+
return new FocusSymbol(x ?? this.x, y ?? this.y, deadEnd ?? this.deadEnd, number ?? this.number);
|
|
81
109
|
}
|
|
82
110
|
withNumber(number) {
|
|
83
111
|
return this.copyWith({ number });
|
|
84
112
|
}
|
|
113
|
+
withDeadEnd(deadEnd) {
|
|
114
|
+
return this.copyWith({ deadEnd });
|
|
115
|
+
}
|
|
85
116
|
}
|
|
86
117
|
Object.defineProperty(FocusSymbol, "CONFIGS", {
|
|
87
118
|
enumerable: true,
|
|
@@ -102,11 +133,20 @@ Object.defineProperty(FocusSymbol, "CONFIGS", {
|
|
|
102
133
|
description: 'Y',
|
|
103
134
|
configurable: false,
|
|
104
135
|
},
|
|
136
|
+
{
|
|
137
|
+
type: ConfigType.Boolean,
|
|
138
|
+
default: false,
|
|
139
|
+
field: 'deadEnd',
|
|
140
|
+
description: 'Dead End',
|
|
141
|
+
explanation: 'A Dead End is a Focus Number of 1 that can be stacked with other symbols.',
|
|
142
|
+
configurable: true,
|
|
143
|
+
},
|
|
105
144
|
{
|
|
106
145
|
type: ConfigType.Number,
|
|
107
146
|
default: 1,
|
|
108
147
|
field: 'number',
|
|
109
148
|
description: 'Number',
|
|
149
|
+
explanation: 'Must be 1 for Dead Ends. Between 0 and 4 for Focus Numbers.',
|
|
110
150
|
configurable: true,
|
|
111
151
|
},
|
|
112
152
|
])
|
|
@@ -116,10 +156,24 @@ Object.defineProperty(FocusSymbol, "EXAMPLE_GRID", {
|
|
|
116
156
|
configurable: true,
|
|
117
157
|
writable: true,
|
|
118
158
|
value: Object.freeze(GridData.create(['wwwww', 'bbbbw', 'wwbbw', 'wwwww']).withSymbols([
|
|
119
|
-
new FocusSymbol(0, 0, 1),
|
|
120
|
-
new FocusSymbol(4, 1, 2),
|
|
121
|
-
new FocusSymbol(1, 3, 3),
|
|
159
|
+
new FocusSymbol(0, 0, false, 1),
|
|
160
|
+
new FocusSymbol(4, 1, false, 2),
|
|
161
|
+
new FocusSymbol(1, 3, false, 3),
|
|
162
|
+
]))
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(FocusSymbol, "EXAMPLE_GRID_DEAD_END", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
configurable: true,
|
|
167
|
+
writable: true,
|
|
168
|
+
value: Object.freeze(GridData.create(['wwwww', 'bbbbw', 'wwwbw', 'bbbbw']).withSymbols([
|
|
169
|
+
new FocusSymbol(0, 0, true, 1),
|
|
170
|
+
new FocusSymbol(4, 3, true, 1),
|
|
171
|
+
new FocusSymbol(0, 2, true, 1),
|
|
172
|
+
new FocusSymbol(2, 2, true, 1),
|
|
173
|
+
new AreaNumberSymbol(0, 2, 3),
|
|
174
|
+
new LetterSymbol(0, 0, 'A'),
|
|
175
|
+
new LetterSymbol(4, 3, 'A'),
|
|
122
176
|
]))
|
|
123
177
|
});
|
|
124
178
|
export default FocusSymbol;
|
|
125
|
-
export const instance = new FocusSymbol(0, 0, 1);
|
|
179
|
+
export const instance = new FocusSymbol(0, 0, false, 1);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AnyConfig } from '../config.js';
|
|
2
|
+
import { SymbolMergeHandler } from '../events/onSymbolMerge.js';
|
|
2
3
|
import GridData from '../grid.js';
|
|
3
4
|
import { OrientationToggle, State } from '../primitives.js';
|
|
4
|
-
import
|
|
5
|
-
export default class MyopiaSymbol extends
|
|
5
|
+
import Symbol from './symbol.js';
|
|
6
|
+
export default class MyopiaSymbol extends Symbol implements SymbolMergeHandler {
|
|
6
7
|
readonly diagonals: boolean;
|
|
7
8
|
readonly directions: OrientationToggle;
|
|
8
9
|
get title(): "Framed Myopia Arrow" | "Myopia Arrow";
|
|
@@ -23,6 +24,7 @@ export default class MyopiaSymbol extends MultiEntrySymbol {
|
|
|
23
24
|
get configs(): readonly AnyConfig[] | null;
|
|
24
25
|
createExampleGrid(): GridData;
|
|
25
26
|
validateSymbol(grid: GridData): State;
|
|
27
|
+
descriptionEquals(other: Symbol): boolean;
|
|
26
28
|
copyWith({ x, y, diagonals, directions, }: {
|
|
27
29
|
x?: number;
|
|
28
30
|
y?: number;
|
|
@@ -2,8 +2,8 @@ import { ConfigType } from '../config.js';
|
|
|
2
2
|
import { move } from '../dataHelper.js';
|
|
3
3
|
import GridData from '../grid.js';
|
|
4
4
|
import { Color, ORIENTATIONS, Orientation, State, orientationToggle, } from '../primitives.js';
|
|
5
|
-
import
|
|
6
|
-
class MyopiaSymbol extends
|
|
5
|
+
import Symbol from './symbol.js';
|
|
6
|
+
class MyopiaSymbol extends Symbol {
|
|
7
7
|
get title() {
|
|
8
8
|
return this.diagonals ? 'Framed Myopia Arrow' : 'Myopia Arrow';
|
|
9
9
|
}
|
|
@@ -134,6 +134,9 @@ class MyopiaSymbol extends MultiEntrySymbol {
|
|
|
134
134
|
return State.Satisfied;
|
|
135
135
|
return State.Incomplete;
|
|
136
136
|
}
|
|
137
|
+
descriptionEquals(other) {
|
|
138
|
+
return this.id === other.id && this.explanation === other.explanation;
|
|
139
|
+
}
|
|
137
140
|
copyWith({ x, y, diagonals, directions, }) {
|
|
138
141
|
return new MyopiaSymbol(x ?? this.x, y ?? this.y, diagonals ?? this.diagonals, directions ?? this.directions);
|
|
139
142
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { handlesGridChange } from './data/events/onGridChange.js';
|
|
|
8
8
|
import { handlesGridResize } from './data/events/onGridResize.js';
|
|
9
9
|
import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
|
|
10
10
|
import { handlesSymbolDisplay } from './data/events/onSymbolDisplay.js';
|
|
11
|
+
import { handlesSymbolMerge } from './data/events/onSymbolMerge.js';
|
|
11
12
|
import { handlesSymbolValidation } from './data/events/onSymbolValidation.js';
|
|
12
13
|
import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
|
|
13
14
|
import GridConnections from './data/gridConnections.js';
|
|
@@ -107,7 +108,6 @@ import { allSymbols } from './data/symbols/index.js';
|
|
|
107
108
|
import LetterSymbol from './data/symbols/letterSymbol.js';
|
|
108
109
|
import LotusSymbol from './data/symbols/lotusSymbol.js';
|
|
109
110
|
import MinesweeperSymbol from './data/symbols/minesweeperSymbol.js';
|
|
110
|
-
import MultiEntrySymbol from './data/symbols/multiEntrySymbol.js';
|
|
111
111
|
import MyopiaSymbol from './data/symbols/myopiaSymbol.js';
|
|
112
112
|
import NumberSymbol from './data/symbols/numberSymbol.js';
|
|
113
113
|
import Symbol from './data/symbols/symbol.js';
|
|
@@ -116,4 +116,4 @@ import TileData from './data/tile.js';
|
|
|
116
116
|
import TileConnections from './data/tileConnections.js';
|
|
117
117
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
118
118
|
import { GridValidator } from './data/validateAsync.js';
|
|
119
|
-
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, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, 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, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol,
|
|
119
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, 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, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, GridValidator, };
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { handlesGridChange } from './data/events/onGridChange.js';
|
|
|
11
11
|
import { handlesGridResize } from './data/events/onGridResize.js';
|
|
12
12
|
import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
|
|
13
13
|
import { handlesSymbolDisplay } from './data/events/onSymbolDisplay.js';
|
|
14
|
+
import { handlesSymbolMerge } from './data/events/onSymbolMerge.js';
|
|
14
15
|
import { handlesSymbolValidation } from './data/events/onSymbolValidation.js';
|
|
15
16
|
import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
|
|
16
17
|
import GridConnections from './data/gridConnections.js';
|
|
@@ -110,7 +111,6 @@ import { allSymbols } from './data/symbols/index.js';
|
|
|
110
111
|
import LetterSymbol from './data/symbols/letterSymbol.js';
|
|
111
112
|
import LotusSymbol from './data/symbols/lotusSymbol.js';
|
|
112
113
|
import MinesweeperSymbol from './data/symbols/minesweeperSymbol.js';
|
|
113
|
-
import MultiEntrySymbol from './data/symbols/multiEntrySymbol.js';
|
|
114
114
|
import MyopiaSymbol from './data/symbols/myopiaSymbol.js';
|
|
115
115
|
import NumberSymbol from './data/symbols/numberSymbol.js';
|
|
116
116
|
import Symbol from './data/symbols/symbol.js';
|
|
@@ -119,4 +119,4 @@ import TileData from './data/tile.js';
|
|
|
119
119
|
import TileConnections from './data/tileConnections.js';
|
|
120
120
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
121
121
|
import { GridValidator } from './data/validateAsync.js';
|
|
122
|
-
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, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, 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, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol,
|
|
122
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, 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, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, GridValidator, };
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Instruction from '../instruction.js';
|
|
2
|
-
import Symbol from './symbol.js';
|
|
3
|
-
export default abstract class MultiEntrySymbol extends Symbol {
|
|
4
|
-
/**
|
|
5
|
-
* Determines if the description of two MultiEntrySymbols can be merged when displayed in the UI.
|
|
6
|
-
* @param other - The other MultiEntrySymbol to compare to.
|
|
7
|
-
* @returns Whether the two MultiEntrySymbols have the same description.
|
|
8
|
-
*/
|
|
9
|
-
descriptionEquals(other: Instruction): boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const instance: undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Symbol from './symbol.js';
|
|
2
|
-
export default class MultiEntrySymbol extends Symbol {
|
|
3
|
-
/**
|
|
4
|
-
* Determines if the description of two MultiEntrySymbols can be merged when displayed in the UI.
|
|
5
|
-
* @param other - The other MultiEntrySymbol to compare to.
|
|
6
|
-
* @returns Whether the two MultiEntrySymbols have the same description.
|
|
7
|
-
*/
|
|
8
|
-
descriptionEquals(other) {
|
|
9
|
-
return (this.id === other.id &&
|
|
10
|
-
this.explanation === other.explanation &&
|
|
11
|
-
this.createExampleGrid().equals(other.createExampleGrid()));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export const instance = undefined;
|