@mathscan/math-exercise-engine 1.1.17 → 1.2.1

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/index.d.ts CHANGED
@@ -875,7 +875,7 @@ export declare function compileWithAST(dsl: string): {
875
875
  type: "PairMatcherBlock";
876
876
  name: string;
877
877
  answers: [string, string][];
878
- topItems: {
878
+ groups: [{
879
879
  type: "MatcherItem";
880
880
  inlines: ({
881
881
  value: string;
@@ -923,8 +923,7 @@ export declare function compileWithAST(dsl: string): {
923
923
  size?: number | undefined;
924
924
  })[];
925
925
  itemId: string;
926
- }[];
927
- bottomItems: {
926
+ }[], {
928
927
  type: "MatcherItem";
929
928
  inlines: ({
930
929
  value: string;
@@ -972,7 +971,8 @@ export declare function compileWithAST(dsl: string): {
972
971
  size?: number | undefined;
973
972
  })[];
974
973
  itemId: string;
975
- }[];
974
+ }[]];
975
+ layout?: "rows" | "columns" | undefined;
976
976
  })[];
977
977
  validation?: {
978
978
  type: "SimpleValidation";
@@ -1007,8 +1007,8 @@ export declare function compileWithAST(dsl: string): {
1007
1007
  })[] | undefined;
1008
1008
  };
1009
1009
  json: {
1010
- version: "2.0";
1011
1010
  layout: any[];
1011
+ version: "2.0";
1012
1012
  widgets: Record<string, {
1013
1013
  length: number;
1014
1014
  type: "inline-input";
@@ -1055,18 +1055,18 @@ export declare function compileWithAST(dsl: string): {
1055
1055
  colors?: string[] | undefined;
1056
1056
  } | {
1057
1057
  type: "pair-matcher";
1058
- topItems: {
1058
+ groups: [{
1059
1059
  type: "matcher-item";
1060
1060
  itemId: string;
1061
1061
  id: string;
1062
1062
  content: any[];
1063
- }[];
1064
- bottomItems: {
1063
+ }[], {
1065
1064
  type: "matcher-item";
1066
1065
  itemId: string;
1067
1066
  id: string;
1068
1067
  content: any[];
1069
- }[];
1068
+ }[]];
1069
+ layout?: "rows" | "columns" | undefined;
1070
1070
  } | {
1071
1071
  type: "visual-fraction";
1072
1072
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -5268,7 +5268,8 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
5268
5268
  }>, z.ZodEffects<z.ZodObject<{
5269
5269
  type: z.ZodLiteral<"PairMatcherBlock">;
5270
5270
  name: z.ZodString;
5271
- topItems: z.ZodArray<z.ZodObject<{
5271
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
5272
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
5272
5273
  type: z.ZodLiteral<"MatcherItem">;
5273
5274
  itemId: z.ZodString;
5274
5275
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -5556,8 +5557,7 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
5556
5557
  size?: number | undefined;
5557
5558
  })[];
5558
5559
  itemId: string;
5559
- }>, "many">;
5560
- bottomItems: z.ZodArray<z.ZodObject<{
5560
+ }>, "many">, z.ZodArray<z.ZodObject<{
5561
5561
  type: z.ZodLiteral<"MatcherItem">;
5562
5562
  itemId: z.ZodString;
5563
5563
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -5845,13 +5845,13 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
5845
5845
  size?: number | undefined;
5846
5846
  })[];
5847
5847
  itemId: string;
5848
- }>, "many">;
5848
+ }>, "many">], null>;
5849
5849
  answers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
5850
5850
  }, "strip", z.ZodTypeAny, {
5851
5851
  type: "PairMatcherBlock";
5852
5852
  name: string;
5853
5853
  answers: [string, string][];
5854
- topItems: {
5854
+ groups: [{
5855
5855
  type: "MatcherItem";
5856
5856
  inlines: ({
5857
5857
  value: string;
@@ -5899,8 +5899,7 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
5899
5899
  size?: number | undefined;
5900
5900
  })[];
5901
5901
  itemId: string;
5902
- }[];
5903
- bottomItems: {
5902
+ }[], {
5904
5903
  type: "MatcherItem";
5905
5904
  inlines: ({
5906
5905
  value: string;
@@ -5948,12 +5947,13 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
5948
5947
  size?: number | undefined;
5949
5948
  })[];
5950
5949
  itemId: string;
5951
- }[];
5950
+ }[]];
5951
+ layout?: "rows" | "columns" | undefined;
5952
5952
  }, {
5953
5953
  type: "PairMatcherBlock";
5954
5954
  name: string;
5955
5955
  answers: [string, string][];
5956
- topItems: {
5956
+ groups: [{
5957
5957
  type: "MatcherItem";
5958
5958
  inlines: ({
5959
5959
  value: string;
@@ -6001,8 +6001,7 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6001
6001
  size?: number | undefined;
6002
6002
  })[];
6003
6003
  itemId: string;
6004
- }[];
6005
- bottomItems: {
6004
+ }[], {
6006
6005
  type: "MatcherItem";
6007
6006
  inlines: ({
6008
6007
  value: string;
@@ -6050,12 +6049,13 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6050
6049
  size?: number | undefined;
6051
6050
  })[];
6052
6051
  itemId: string;
6053
- }[];
6052
+ }[]];
6053
+ layout?: "rows" | "columns" | undefined;
6054
6054
  }>, {
6055
6055
  type: "PairMatcherBlock";
6056
6056
  name: string;
6057
6057
  answers: [string, string][];
6058
- topItems: {
6058
+ groups: [{
6059
6059
  type: "MatcherItem";
6060
6060
  inlines: ({
6061
6061
  value: string;
@@ -6103,8 +6103,7 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6103
6103
  size?: number | undefined;
6104
6104
  })[];
6105
6105
  itemId: string;
6106
- }[];
6107
- bottomItems: {
6106
+ }[], {
6108
6107
  type: "MatcherItem";
6109
6108
  inlines: ({
6110
6109
  value: string;
@@ -6152,12 +6151,13 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6152
6151
  size?: number | undefined;
6153
6152
  })[];
6154
6153
  itemId: string;
6155
- }[];
6154
+ }[]];
6155
+ layout?: "rows" | "columns" | undefined;
6156
6156
  }, {
6157
6157
  type: "PairMatcherBlock";
6158
6158
  name: string;
6159
6159
  answers: [string, string][];
6160
- topItems: {
6160
+ groups: [{
6161
6161
  type: "MatcherItem";
6162
6162
  inlines: ({
6163
6163
  value: string;
@@ -6205,8 +6205,7 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6205
6205
  size?: number | undefined;
6206
6206
  })[];
6207
6207
  itemId: string;
6208
- }[];
6209
- bottomItems: {
6208
+ }[], {
6210
6209
  type: "MatcherItem";
6211
6210
  inlines: ({
6212
6211
  value: string;
@@ -6254,7 +6253,8 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
6254
6253
  size?: number | undefined;
6255
6254
  })[];
6256
6255
  itemId: string;
6257
- }[];
6256
+ }[]];
6257
+ layout?: "rows" | "columns" | undefined;
6258
6258
  }>, z.ZodObject<{
6259
6259
  type: z.ZodLiteral<"VerticalOperationBlock">;
6260
6260
  op: z.ZodOptional<z.ZodEnum<["+", "-", "×", "÷", "="]>>;
@@ -6883,7 +6883,7 @@ export declare function createNumericInput(name: string, digits: number, answer?
6883
6883
  */
6884
6884
  export declare function createNumericKeypad(includeOperators?: boolean, includeDecimal?: boolean, style?: 'diamond' | 'classic'): NumericKeypadTool;
6885
6885
 
6886
- export declare function createPairMatcherBlock(name: string, topItems: MatcherItem[], bottomItems: MatcherItem[], answers: [string, string][]): PairMatcherBlock;
6886
+ export declare function createPairMatcherBlock(name: string, groups: [MatcherItem[], MatcherItem[]], answers: [string, string][], layout?: 'rows' | 'columns'): PairMatcherBlock;
6887
6887
 
6888
6888
  export declare function createProtractorTool(size?: number): ProtractorTool;
6889
6889
 
@@ -11383,7 +11383,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
11383
11383
  }>, z.ZodEffects<z.ZodObject<{
11384
11384
  type: z.ZodLiteral<"PairMatcherBlock">;
11385
11385
  name: z.ZodString;
11386
- topItems: z.ZodArray<z.ZodObject<{
11386
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
11387
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
11387
11388
  type: z.ZodLiteral<"MatcherItem">;
11388
11389
  itemId: z.ZodString;
11389
11390
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -11671,8 +11672,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
11671
11672
  size?: number | undefined;
11672
11673
  })[];
11673
11674
  itemId: string;
11674
- }>, "many">;
11675
- bottomItems: z.ZodArray<z.ZodObject<{
11675
+ }>, "many">, z.ZodArray<z.ZodObject<{
11676
11676
  type: z.ZodLiteral<"MatcherItem">;
11677
11677
  itemId: z.ZodString;
11678
11678
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -11960,13 +11960,13 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
11960
11960
  size?: number | undefined;
11961
11961
  })[];
11962
11962
  itemId: string;
11963
- }>, "many">;
11963
+ }>, "many">], null>;
11964
11964
  answers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
11965
11965
  }, "strip", z.ZodTypeAny, {
11966
11966
  type: "PairMatcherBlock";
11967
11967
  name: string;
11968
11968
  answers: [string, string][];
11969
- topItems: {
11969
+ groups: [{
11970
11970
  type: "MatcherItem";
11971
11971
  inlines: ({
11972
11972
  value: string;
@@ -12014,8 +12014,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12014
12014
  size?: number | undefined;
12015
12015
  })[];
12016
12016
  itemId: string;
12017
- }[];
12018
- bottomItems: {
12017
+ }[], {
12019
12018
  type: "MatcherItem";
12020
12019
  inlines: ({
12021
12020
  value: string;
@@ -12063,12 +12062,13 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12063
12062
  size?: number | undefined;
12064
12063
  })[];
12065
12064
  itemId: string;
12066
- }[];
12065
+ }[]];
12066
+ layout?: "rows" | "columns" | undefined;
12067
12067
  }, {
12068
12068
  type: "PairMatcherBlock";
12069
12069
  name: string;
12070
12070
  answers: [string, string][];
12071
- topItems: {
12071
+ groups: [{
12072
12072
  type: "MatcherItem";
12073
12073
  inlines: ({
12074
12074
  value: string;
@@ -12116,8 +12116,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12116
12116
  size?: number | undefined;
12117
12117
  })[];
12118
12118
  itemId: string;
12119
- }[];
12120
- bottomItems: {
12119
+ }[], {
12121
12120
  type: "MatcherItem";
12122
12121
  inlines: ({
12123
12122
  value: string;
@@ -12165,12 +12164,13 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12165
12164
  size?: number | undefined;
12166
12165
  })[];
12167
12166
  itemId: string;
12168
- }[];
12167
+ }[]];
12168
+ layout?: "rows" | "columns" | undefined;
12169
12169
  }>, {
12170
12170
  type: "PairMatcherBlock";
12171
12171
  name: string;
12172
12172
  answers: [string, string][];
12173
- topItems: {
12173
+ groups: [{
12174
12174
  type: "MatcherItem";
12175
12175
  inlines: ({
12176
12176
  value: string;
@@ -12218,8 +12218,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12218
12218
  size?: number | undefined;
12219
12219
  })[];
12220
12220
  itemId: string;
12221
- }[];
12222
- bottomItems: {
12221
+ }[], {
12223
12222
  type: "MatcherItem";
12224
12223
  inlines: ({
12225
12224
  value: string;
@@ -12267,12 +12266,13 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12267
12266
  size?: number | undefined;
12268
12267
  })[];
12269
12268
  itemId: string;
12270
- }[];
12269
+ }[]];
12270
+ layout?: "rows" | "columns" | undefined;
12271
12271
  }, {
12272
12272
  type: "PairMatcherBlock";
12273
12273
  name: string;
12274
12274
  answers: [string, string][];
12275
- topItems: {
12275
+ groups: [{
12276
12276
  type: "MatcherItem";
12277
12277
  inlines: ({
12278
12278
  value: string;
@@ -12320,8 +12320,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12320
12320
  size?: number | undefined;
12321
12321
  })[];
12322
12322
  itemId: string;
12323
- }[];
12324
- bottomItems: {
12323
+ }[], {
12325
12324
  type: "MatcherItem";
12326
12325
  inlines: ({
12327
12326
  value: string;
@@ -12369,7 +12368,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
12369
12368
  size?: number | undefined;
12370
12369
  })[];
12371
12370
  itemId: string;
12372
- }[];
12371
+ }[]];
12372
+ layout?: "rows" | "columns" | undefined;
12373
12373
  }>, z.ZodObject<{
12374
12374
  type: z.ZodLiteral<"VerticalOperationBlock">;
12375
12375
  op: z.ZodOptional<z.ZodEnum<["+", "-", "×", "÷", "="]>>;
@@ -13483,7 +13483,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
13483
13483
  type: "PairMatcherBlock";
13484
13484
  name: string;
13485
13485
  answers: [string, string][];
13486
- topItems: {
13486
+ groups: [{
13487
13487
  type: "MatcherItem";
13488
13488
  inlines: ({
13489
13489
  value: string;
@@ -13531,8 +13531,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
13531
13531
  size?: number | undefined;
13532
13532
  })[];
13533
13533
  itemId: string;
13534
- }[];
13535
- bottomItems: {
13534
+ }[], {
13536
13535
  type: "MatcherItem";
13537
13536
  inlines: ({
13538
13537
  value: string;
@@ -13580,7 +13579,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
13580
13579
  size?: number | undefined;
13581
13580
  })[];
13582
13581
  itemId: string;
13583
- }[];
13582
+ }[]];
13583
+ layout?: "rows" | "columns" | undefined;
13584
13584
  })[];
13585
13585
  validation?: {
13586
13586
  type: "SimpleValidation";
@@ -14131,7 +14131,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14131
14131
  type: "PairMatcherBlock";
14132
14132
  name: string;
14133
14133
  answers: [string, string][];
14134
- topItems: {
14134
+ groups: [{
14135
14135
  type: "MatcherItem";
14136
14136
  inlines: ({
14137
14137
  value: string;
@@ -14179,8 +14179,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14179
14179
  size?: number | undefined;
14180
14180
  })[];
14181
14181
  itemId: string;
14182
- }[];
14183
- bottomItems: {
14182
+ }[], {
14184
14183
  type: "MatcherItem";
14185
14184
  inlines: ({
14186
14185
  value: string;
@@ -14228,7 +14227,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14228
14227
  size?: number | undefined;
14229
14228
  })[];
14230
14229
  itemId: string;
14231
- }[];
14230
+ }[]];
14231
+ layout?: "rows" | "columns" | undefined;
14232
14232
  })[];
14233
14233
  validation?: {
14234
14234
  type: "SimpleValidation";
@@ -14779,7 +14779,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14779
14779
  type: "PairMatcherBlock";
14780
14780
  name: string;
14781
14781
  answers: [string, string][];
14782
- topItems: {
14782
+ groups: [{
14783
14783
  type: "MatcherItem";
14784
14784
  inlines: ({
14785
14785
  value: string;
@@ -14827,8 +14827,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14827
14827
  size?: number | undefined;
14828
14828
  })[];
14829
14829
  itemId: string;
14830
- }[];
14831
- bottomItems: {
14830
+ }[], {
14832
14831
  type: "MatcherItem";
14833
14832
  inlines: ({
14834
14833
  value: string;
@@ -14876,7 +14875,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
14876
14875
  size?: number | undefined;
14877
14876
  })[];
14878
14877
  itemId: string;
14879
- }[];
14878
+ }[]];
14879
+ layout?: "rows" | "columns" | undefined;
14880
14880
  })[];
14881
14881
  validation?: {
14882
14882
  type: "SimpleValidation";
@@ -15427,7 +15427,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
15427
15427
  type: "PairMatcherBlock";
15428
15428
  name: string;
15429
15429
  answers: [string, string][];
15430
- topItems: {
15430
+ groups: [{
15431
15431
  type: "MatcherItem";
15432
15432
  inlines: ({
15433
15433
  value: string;
@@ -15475,8 +15475,7 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
15475
15475
  size?: number | undefined;
15476
15476
  })[];
15477
15477
  itemId: string;
15478
- }[];
15479
- bottomItems: {
15478
+ }[], {
15480
15479
  type: "MatcherItem";
15481
15480
  inlines: ({
15482
15481
  value: string;
@@ -15524,7 +15523,8 @@ export declare const ExerciseDocumentSchema: z.ZodEffects<z.ZodObject<{
15524
15523
  size?: number | undefined;
15525
15524
  })[];
15526
15525
  itemId: string;
15527
- }[];
15526
+ }[]];
15527
+ layout?: "rows" | "columns" | undefined;
15528
15528
  })[];
15529
15529
  validation?: {
15530
15530
  type: "SimpleValidation";
@@ -15731,7 +15731,9 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
15731
15731
  colors?: string[] | undefined;
15732
15732
  }>, z.ZodObject<{
15733
15733
  type: z.ZodLiteral<"pair-matcher">;
15734
- topItems: z.ZodArray<z.ZodObject<{
15734
+ /** Row layout (top/bottom, default) or column layout (left/right). */
15735
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
15736
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
15735
15737
  id: z.ZodString;
15736
15738
  type: z.ZodLiteral<"matcher-item">;
15737
15739
  /** Item identifier (no pipe allowed) */
@@ -15748,8 +15750,7 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
15748
15750
  itemId: string;
15749
15751
  id: string;
15750
15752
  content: any[];
15751
- }>, "many">;
15752
- bottomItems: z.ZodArray<z.ZodObject<{
15753
+ }>, "many">, z.ZodArray<z.ZodObject<{
15753
15754
  id: z.ZodString;
15754
15755
  type: z.ZodLiteral<"matcher-item">;
15755
15756
  /** Item identifier (no pipe allowed) */
@@ -15766,35 +15767,35 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
15766
15767
  itemId: string;
15767
15768
  id: string;
15768
15769
  content: any[];
15769
- }>, "many">;
15770
+ }>, "many">], null>;
15770
15771
  }, "strip", z.ZodTypeAny, {
15771
15772
  type: "pair-matcher";
15772
- topItems: {
15773
+ groups: [{
15773
15774
  type: "matcher-item";
15774
15775
  itemId: string;
15775
15776
  id: string;
15776
15777
  content: any[];
15777
- }[];
15778
- bottomItems: {
15778
+ }[], {
15779
15779
  type: "matcher-item";
15780
15780
  itemId: string;
15781
15781
  id: string;
15782
15782
  content: any[];
15783
- }[];
15783
+ }[]];
15784
+ layout?: "rows" | "columns" | undefined;
15784
15785
  }, {
15785
15786
  type: "pair-matcher";
15786
- topItems: {
15787
+ groups: [{
15787
15788
  type: "matcher-item";
15788
15789
  itemId: string;
15789
15790
  id: string;
15790
15791
  content: any[];
15791
- }[];
15792
- bottomItems: {
15792
+ }[], {
15793
15793
  type: "matcher-item";
15794
15794
  itemId: string;
15795
15795
  id: string;
15796
15796
  content: any[];
15797
- }[];
15797
+ }[]];
15798
+ layout?: "rows" | "columns" | undefined;
15798
15799
  }>, z.ZodEffects<z.ZodObject<{
15799
15800
  type: z.ZodLiteral<"visual-fraction">;
15800
15801
  shape: z.ZodDefault<z.ZodEnum<["bar", "circle", "triangle", "grid"]>>;
@@ -15946,8 +15947,8 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
15946
15947
  difficulty?: number | undefined;
15947
15948
  }>>;
15948
15949
  }, "strip", z.ZodTypeAny, {
15949
- version: "2.0";
15950
15950
  layout: any[];
15951
+ version: "2.0";
15951
15952
  widgets: Record<string, {
15952
15953
  length: number;
15953
15954
  type: "inline-input";
@@ -15994,18 +15995,18 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
15994
15995
  colors?: string[] | undefined;
15995
15996
  } | {
15996
15997
  type: "pair-matcher";
15997
- topItems: {
15998
+ groups: [{
15998
15999
  type: "matcher-item";
15999
16000
  itemId: string;
16000
16001
  id: string;
16001
16002
  content: any[];
16002
- }[];
16003
- bottomItems: {
16003
+ }[], {
16004
16004
  type: "matcher-item";
16005
16005
  itemId: string;
16006
16006
  id: string;
16007
16007
  content: any[];
16008
- }[];
16008
+ }[]];
16009
+ layout?: "rows" | "columns" | undefined;
16009
16010
  } | {
16010
16011
  type: "visual-fraction";
16011
16012
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -16047,8 +16048,8 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
16047
16048
  difficulty?: number | undefined;
16048
16049
  } | undefined;
16049
16050
  }, {
16050
- version: "2.0";
16051
16051
  layout: any[];
16052
+ version: "2.0";
16052
16053
  widgets: Record<string, {
16053
16054
  length: number;
16054
16055
  type: "inline-input";
@@ -16095,18 +16096,18 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
16095
16096
  colors?: string[] | undefined;
16096
16097
  } | {
16097
16098
  type: "pair-matcher";
16098
- topItems: {
16099
+ groups: [{
16099
16100
  type: "matcher-item";
16100
16101
  itemId: string;
16101
16102
  id: string;
16102
16103
  content: any[];
16103
- }[];
16104
- bottomItems: {
16104
+ }[], {
16105
16105
  type: "matcher-item";
16106
16106
  itemId: string;
16107
16107
  id: string;
16108
16108
  content: any[];
16109
- }[];
16109
+ }[]];
16110
+ layout?: "rows" | "columns" | undefined;
16110
16111
  } | {
16111
16112
  type: "visual-fraction";
16112
16113
  answer: number[];
@@ -16149,6 +16150,20 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
16149
16150
  } | undefined;
16150
16151
  }>;
16151
16152
 
16153
+ /**
16154
+ * Broadcasts the exercise lock to every widget.
16155
+ *
16156
+ * A context (rather than a prop threaded through LayoutRenderer → WidgetRenderer)
16157
+ * because interactive elements sit 3–4 levels deep (number-line arcs, matcher
16158
+ * cards, DnD chips rendered into a body portal).
16159
+ */
16160
+ export declare const ExerciseLockProvider: default_2.FC<ExerciseLockProviderProps>;
16161
+
16162
+ export declare interface ExerciseLockProviderProps {
16163
+ locked: boolean;
16164
+ children: default_2.ReactNode;
16165
+ }
16166
+
16152
16167
  export declare type ExerciseMeta = z.infer<typeof ExerciseMetaSchema>;
16153
16168
 
16154
16169
  export declare const ExerciseMetaSchema: z.ZodObject<{
@@ -23223,8 +23238,10 @@ export declare type PairMatcherBlock = z.infer<typeof PairMatcherBlockSchema>;
23223
23238
  export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23224
23239
  type: z.ZodLiteral<"PairMatcherBlock">;
23225
23240
  name: z.ZodString;
23226
- /** Items in the top row — at least one required */
23227
- topItems: z.ZodArray<z.ZodObject<{
23241
+ /** Row layout (top/bottom, default) or column layout (left/right). */
23242
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
23243
+ /** Exactly two groups, in declaration order — neither more nor fewer. */
23244
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
23228
23245
  type: z.ZodLiteral<"MatcherItem">;
23229
23246
  itemId: z.ZodString;
23230
23247
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -23512,9 +23529,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23512
23529
  size?: number | undefined;
23513
23530
  })[];
23514
23531
  itemId: string;
23515
- }>, "many">;
23516
- /** Items in the bottom row — at least one required */
23517
- bottomItems: z.ZodArray<z.ZodObject<{
23532
+ }>, "many">, z.ZodArray<z.ZodObject<{
23518
23533
  type: z.ZodLiteral<"MatcherItem">;
23519
23534
  itemId: z.ZodString;
23520
23535
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -23802,9 +23817,9 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23802
23817
  size?: number | undefined;
23803
23818
  })[];
23804
23819
  itemId: string;
23805
- }>, "many">;
23820
+ }>, "many">], null>;
23806
23821
  /**
23807
- * Each answer pair is [topId, bottomId].
23822
+ * Each answer pair is [groups[0] id, groups[1] id].
23808
23823
  * At least one pair is required.
23809
23824
  */
23810
23825
  answers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
@@ -23812,7 +23827,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23812
23827
  type: "PairMatcherBlock";
23813
23828
  name: string;
23814
23829
  answers: [string, string][];
23815
- topItems: {
23830
+ groups: [{
23816
23831
  type: "MatcherItem";
23817
23832
  inlines: ({
23818
23833
  value: string;
@@ -23860,8 +23875,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23860
23875
  size?: number | undefined;
23861
23876
  })[];
23862
23877
  itemId: string;
23863
- }[];
23864
- bottomItems: {
23878
+ }[], {
23865
23879
  type: "MatcherItem";
23866
23880
  inlines: ({
23867
23881
  value: string;
@@ -23909,12 +23923,13 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23909
23923
  size?: number | undefined;
23910
23924
  })[];
23911
23925
  itemId: string;
23912
- }[];
23926
+ }[]];
23927
+ layout?: "rows" | "columns" | undefined;
23913
23928
  }, {
23914
23929
  type: "PairMatcherBlock";
23915
23930
  name: string;
23916
23931
  answers: [string, string][];
23917
- topItems: {
23932
+ groups: [{
23918
23933
  type: "MatcherItem";
23919
23934
  inlines: ({
23920
23935
  value: string;
@@ -23962,8 +23977,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
23962
23977
  size?: number | undefined;
23963
23978
  })[];
23964
23979
  itemId: string;
23965
- }[];
23966
- bottomItems: {
23980
+ }[], {
23967
23981
  type: "MatcherItem";
23968
23982
  inlines: ({
23969
23983
  value: string;
@@ -24011,12 +24025,13 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
24011
24025
  size?: number | undefined;
24012
24026
  })[];
24013
24027
  itemId: string;
24014
- }[];
24028
+ }[]];
24029
+ layout?: "rows" | "columns" | undefined;
24015
24030
  }>, {
24016
24031
  type: "PairMatcherBlock";
24017
24032
  name: string;
24018
24033
  answers: [string, string][];
24019
- topItems: {
24034
+ groups: [{
24020
24035
  type: "MatcherItem";
24021
24036
  inlines: ({
24022
24037
  value: string;
@@ -24064,8 +24079,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
24064
24079
  size?: number | undefined;
24065
24080
  })[];
24066
24081
  itemId: string;
24067
- }[];
24068
- bottomItems: {
24082
+ }[], {
24069
24083
  type: "MatcherItem";
24070
24084
  inlines: ({
24071
24085
  value: string;
@@ -24113,12 +24127,13 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
24113
24127
  size?: number | undefined;
24114
24128
  })[];
24115
24129
  itemId: string;
24116
- }[];
24130
+ }[]];
24131
+ layout?: "rows" | "columns" | undefined;
24117
24132
  }, {
24118
24133
  type: "PairMatcherBlock";
24119
24134
  name: string;
24120
24135
  answers: [string, string][];
24121
- topItems: {
24136
+ groups: [{
24122
24137
  type: "MatcherItem";
24123
24138
  inlines: ({
24124
24139
  value: string;
@@ -24166,8 +24181,7 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
24166
24181
  size?: number | undefined;
24167
24182
  })[];
24168
24183
  itemId: string;
24169
- }[];
24170
- bottomItems: {
24184
+ }[], {
24171
24185
  type: "MatcherItem";
24172
24186
  inlines: ({
24173
24187
  value: string;
@@ -24215,18 +24229,23 @@ export declare const PairMatcherBlockSchema: z.ZodEffects<z.ZodObject<{
24215
24229
  size?: number | undefined;
24216
24230
  })[];
24217
24231
  itemId: string;
24218
- }[];
24232
+ }[]];
24233
+ layout?: "rows" | "columns" | undefined;
24219
24234
  }>;
24220
24235
 
24221
24236
  export declare type PairMatcherWidgetJSON = z.infer<typeof PairMatcherWidgetJSONSchema>;
24222
24237
 
24223
24238
  /**
24224
- * Pair-Matcher widget — top row ↔ bottom row pairing.
24225
- * topItems / bottomItems carry IDs for React keys.
24239
+ * Pair-Matcher widget — two-group item pairing.
24240
+ * `groups` is a fixed 2-tuple, in declaration order; items carry IDs for
24241
+ * React keys. Neither group has a spatial meaning — `layout` decides whether
24242
+ * they render as rows or columns.
24226
24243
  */
24227
24244
  export declare const PairMatcherWidgetJSONSchema: z.ZodObject<{
24228
24245
  type: z.ZodLiteral<"pair-matcher">;
24229
- topItems: z.ZodArray<z.ZodObject<{
24246
+ /** Row layout (top/bottom, default) or column layout (left/right). */
24247
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
24248
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
24230
24249
  id: z.ZodString;
24231
24250
  type: z.ZodLiteral<"matcher-item">;
24232
24251
  /** Item identifier (no pipe allowed) */
@@ -24243,8 +24262,7 @@ export declare const PairMatcherWidgetJSONSchema: z.ZodObject<{
24243
24262
  itemId: string;
24244
24263
  id: string;
24245
24264
  content: any[];
24246
- }>, "many">;
24247
- bottomItems: z.ZodArray<z.ZodObject<{
24265
+ }>, "many">, z.ZodArray<z.ZodObject<{
24248
24266
  id: z.ZodString;
24249
24267
  type: z.ZodLiteral<"matcher-item">;
24250
24268
  /** Item identifier (no pipe allowed) */
@@ -24261,35 +24279,35 @@ export declare const PairMatcherWidgetJSONSchema: z.ZodObject<{
24261
24279
  itemId: string;
24262
24280
  id: string;
24263
24281
  content: any[];
24264
- }>, "many">;
24282
+ }>, "many">], null>;
24265
24283
  }, "strip", z.ZodTypeAny, {
24266
24284
  type: "pair-matcher";
24267
- topItems: {
24285
+ groups: [{
24268
24286
  type: "matcher-item";
24269
24287
  itemId: string;
24270
24288
  id: string;
24271
24289
  content: any[];
24272
- }[];
24273
- bottomItems: {
24290
+ }[], {
24274
24291
  type: "matcher-item";
24275
24292
  itemId: string;
24276
24293
  id: string;
24277
24294
  content: any[];
24278
- }[];
24295
+ }[]];
24296
+ layout?: "rows" | "columns" | undefined;
24279
24297
  }, {
24280
24298
  type: "pair-matcher";
24281
- topItems: {
24299
+ groups: [{
24282
24300
  type: "matcher-item";
24283
24301
  itemId: string;
24284
24302
  id: string;
24285
24303
  content: any[];
24286
- }[];
24287
- bottomItems: {
24304
+ }[], {
24288
24305
  type: "matcher-item";
24289
24306
  itemId: string;
24290
24307
  id: string;
24291
24308
  content: any[];
24292
- }[];
24309
+ }[]];
24310
+ layout?: "rows" | "columns" | undefined;
24293
24311
  }>;
24294
24312
 
24295
24313
  /**
@@ -26727,6 +26745,9 @@ export declare class TransformError extends EngineError {
26727
26745
  constructor(message: string, position?: SourcePosition);
26728
26746
  }
26729
26747
 
26748
+ /** true once the exercise was checked/revealed — widgets must refuse input until reset(). */
26749
+ export declare const useExerciseLocked: () => boolean;
26750
+
26730
26751
  /** User answers keyed by widget ID. */
26731
26752
  export declare type UserAnswers = Record<string, UserAnswerValue>;
26732
26753
 
@@ -26791,8 +26812,8 @@ declare type ValidatedExerciseJSON = ExerciseJSON & {
26791
26812
  * ```
26792
26813
  */
26793
26814
  export declare function validateExerciseJSON(data: unknown): {
26794
- version: "2.0";
26795
26815
  layout: any[];
26816
+ version: "2.0";
26796
26817
  widgets: Record<string, {
26797
26818
  length: number;
26798
26819
  type: "inline-input";
@@ -26839,18 +26860,18 @@ export declare function validateExerciseJSON(data: unknown): {
26839
26860
  colors?: string[] | undefined;
26840
26861
  } | {
26841
26862
  type: "pair-matcher";
26842
- topItems: {
26863
+ groups: [{
26843
26864
  type: "matcher-item";
26844
26865
  itemId: string;
26845
26866
  id: string;
26846
26867
  content: any[];
26847
- }[];
26848
- bottomItems: {
26868
+ }[], {
26849
26869
  type: "matcher-item";
26850
26870
  itemId: string;
26851
26871
  id: string;
26852
26872
  content: any[];
26853
- }[];
26873
+ }[]];
26874
+ layout?: "rows" | "columns" | undefined;
26854
26875
  } | {
26855
26876
  type: "visual-fraction";
26856
26877
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -26910,8 +26931,8 @@ export declare function validateExerciseJSON(data: unknown): {
26910
26931
  * ```
26911
26932
  */
26912
26933
  export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseReturnType<{
26913
- version: "2.0";
26914
26934
  layout: any[];
26935
+ version: "2.0";
26915
26936
  widgets: Record<string, {
26916
26937
  length: number;
26917
26938
  type: "inline-input";
@@ -26958,18 +26979,18 @@ export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseRetu
26958
26979
  colors?: string[] | undefined;
26959
26980
  } | {
26960
26981
  type: "pair-matcher";
26961
- topItems: {
26982
+ groups: [{
26962
26983
  type: "matcher-item";
26963
26984
  itemId: string;
26964
26985
  id: string;
26965
26986
  content: any[];
26966
- }[];
26967
- bottomItems: {
26987
+ }[], {
26968
26988
  type: "matcher-item";
26969
26989
  itemId: string;
26970
26990
  id: string;
26971
26991
  content: any[];
26972
- }[];
26992
+ }[]];
26993
+ layout?: "rows" | "columns" | undefined;
26973
26994
  } | {
26974
26995
  type: "visual-fraction";
26975
26996
  answer: number[];
@@ -27011,8 +27032,8 @@ export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseRetu
27011
27032
  difficulty?: number | undefined;
27012
27033
  } | undefined;
27013
27034
  }, {
27014
- version: "2.0";
27015
27035
  layout: any[];
27036
+ version: "2.0";
27016
27037
  widgets: Record<string, {
27017
27038
  length: number;
27018
27039
  type: "inline-input";
@@ -27059,18 +27080,18 @@ export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseRetu
27059
27080
  colors?: string[] | undefined;
27060
27081
  } | {
27061
27082
  type: "pair-matcher";
27062
- topItems: {
27083
+ groups: [{
27063
27084
  type: "matcher-item";
27064
27085
  itemId: string;
27065
27086
  id: string;
27066
27087
  content: any[];
27067
- }[];
27068
- bottomItems: {
27088
+ }[], {
27069
27089
  type: "matcher-item";
27070
27090
  itemId: string;
27071
27091
  id: string;
27072
27092
  content: any[];
27073
- }[];
27093
+ }[]];
27094
+ layout?: "rows" | "columns" | undefined;
27074
27095
  } | {
27075
27096
  type: "visual-fraction";
27076
27097
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -27210,18 +27231,18 @@ export declare function validateWidgetJSON(data: unknown): {
27210
27231
  colors?: string[] | undefined;
27211
27232
  } | {
27212
27233
  type: "pair-matcher";
27213
- topItems: {
27234
+ groups: [{
27214
27235
  type: "matcher-item";
27215
27236
  itemId: string;
27216
27237
  id: string;
27217
27238
  content: any[];
27218
- }[];
27219
- bottomItems: {
27239
+ }[], {
27220
27240
  type: "matcher-item";
27221
27241
  itemId: string;
27222
27242
  id: string;
27223
27243
  content: any[];
27224
- }[];
27244
+ }[]];
27245
+ layout?: "rows" | "columns" | undefined;
27225
27246
  } | {
27226
27247
  type: "visual-fraction";
27227
27248
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -27302,18 +27323,18 @@ export declare function validateWidgetJSONSafe(data: unknown): z.SafeParseReturn
27302
27323
  colors?: string[] | undefined;
27303
27324
  } | {
27304
27325
  type: "pair-matcher";
27305
- topItems: {
27326
+ groups: [{
27306
27327
  type: "matcher-item";
27307
27328
  itemId: string;
27308
27329
  id: string;
27309
27330
  content: any[];
27310
- }[];
27311
- bottomItems: {
27331
+ }[], {
27312
27332
  type: "matcher-item";
27313
27333
  itemId: string;
27314
27334
  id: string;
27315
27335
  content: any[];
27316
- }[];
27336
+ }[]];
27337
+ layout?: "rows" | "columns" | undefined;
27317
27338
  } | {
27318
27339
  type: "visual-fraction";
27319
27340
  answer: number[];
@@ -27386,18 +27407,18 @@ export declare function validateWidgetJSONSafe(data: unknown): z.SafeParseReturn
27386
27407
  colors?: string[] | undefined;
27387
27408
  } | {
27388
27409
  type: "pair-matcher";
27389
- topItems: {
27410
+ groups: [{
27390
27411
  type: "matcher-item";
27391
27412
  itemId: string;
27392
27413
  id: string;
27393
27414
  content: any[];
27394
- }[];
27395
- bottomItems: {
27415
+ }[], {
27396
27416
  type: "matcher-item";
27397
27417
  itemId: string;
27398
27418
  id: string;
27399
27419
  content: any[];
27400
- }[];
27420
+ }[]];
27421
+ layout?: "rows" | "columns" | undefined;
27401
27422
  } | {
27402
27423
  type: "visual-fraction";
27403
27424
  shape: "bar" | "circle" | "triangle" | "grid";
@@ -30337,7 +30358,9 @@ export declare const WidgetJSONSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"inpu
30337
30358
  colors?: string[] | undefined;
30338
30359
  }>, z.ZodObject<{
30339
30360
  type: z.ZodLiteral<"pair-matcher">;
30340
- topItems: z.ZodArray<z.ZodObject<{
30361
+ /** Row layout (top/bottom, default) or column layout (left/right). */
30362
+ layout: z.ZodOptional<z.ZodEnum<["rows", "columns"]>>;
30363
+ groups: z.ZodTuple<[z.ZodArray<z.ZodObject<{
30341
30364
  id: z.ZodString;
30342
30365
  type: z.ZodLiteral<"matcher-item">;
30343
30366
  /** Item identifier (no pipe allowed) */
@@ -30354,8 +30377,7 @@ export declare const WidgetJSONSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"inpu
30354
30377
  itemId: string;
30355
30378
  id: string;
30356
30379
  content: any[];
30357
- }>, "many">;
30358
- bottomItems: z.ZodArray<z.ZodObject<{
30380
+ }>, "many">, z.ZodArray<z.ZodObject<{
30359
30381
  id: z.ZodString;
30360
30382
  type: z.ZodLiteral<"matcher-item">;
30361
30383
  /** Item identifier (no pipe allowed) */
@@ -30372,35 +30394,35 @@ export declare const WidgetJSONSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"inpu
30372
30394
  itemId: string;
30373
30395
  id: string;
30374
30396
  content: any[];
30375
- }>, "many">;
30397
+ }>, "many">], null>;
30376
30398
  }, "strip", z.ZodTypeAny, {
30377
30399
  type: "pair-matcher";
30378
- topItems: {
30400
+ groups: [{
30379
30401
  type: "matcher-item";
30380
30402
  itemId: string;
30381
30403
  id: string;
30382
30404
  content: any[];
30383
- }[];
30384
- bottomItems: {
30405
+ }[], {
30385
30406
  type: "matcher-item";
30386
30407
  itemId: string;
30387
30408
  id: string;
30388
30409
  content: any[];
30389
- }[];
30410
+ }[]];
30411
+ layout?: "rows" | "columns" | undefined;
30390
30412
  }, {
30391
30413
  type: "pair-matcher";
30392
- topItems: {
30414
+ groups: [{
30393
30415
  type: "matcher-item";
30394
30416
  itemId: string;
30395
30417
  id: string;
30396
30418
  content: any[];
30397
- }[];
30398
- bottomItems: {
30419
+ }[], {
30399
30420
  type: "matcher-item";
30400
30421
  itemId: string;
30401
30422
  id: string;
30402
30423
  content: any[];
30403
- }[];
30424
+ }[]];
30425
+ layout?: "rows" | "columns" | undefined;
30404
30426
  }>, z.ZodEffects<z.ZodObject<{
30405
30427
  type: z.ZodLiteral<"visual-fraction">;
30406
30428
  shape: z.ZodDefault<z.ZodEnum<["bar", "circle", "triangle", "grid"]>>;