@mathscan/math-exercise-engine 1.0.7 → 1.0.9

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
@@ -35,8 +35,14 @@ export declare const AST_TYPES: {
35
35
  readonly TABLE_ROW: "TableRow";
36
36
  /** Cell within a table row */
37
37
  readonly TABLE_CELL: "TableCell";
38
+ /** Number line layout block */
39
+ readonly NUMBER_LINE_BLOCK: "NumberLineBlock";
40
+ /** A position marker on the number line */
41
+ readonly NUMBER_LINE_POSITION: "NumberLinePosition";
38
42
  /** Drag-and-drop options tool */
39
43
  readonly DRAG_OPTIONS: "DragOptions";
44
+ /** Radio button options tool */
45
+ readonly RADIO_OPTIONS: "RadioOptions";
40
46
  /** Numeric keypad input tool */
41
47
  readonly NUMERIC_KEYPAD: "NumericKeypad";
42
48
  /** Simple answer matching validation */
@@ -225,6 +231,48 @@ export declare function compileWithAST(dsl: string): {
225
231
  digits: number;
226
232
  answer?: string | number | undefined;
227
233
  })[];
234
+ } | {
235
+ type: "NumberLineBlock";
236
+ min: number;
237
+ max: number;
238
+ step: number;
239
+ positions: {
240
+ value: number;
241
+ type: "NumberLinePosition";
242
+ inlines: ({
243
+ value: string;
244
+ type: "FreeText";
245
+ } | {
246
+ type: "Space";
247
+ } | {
248
+ value: string;
249
+ type: "HighlightedText";
250
+ highlight?: [number, number] | undefined;
251
+ } | {
252
+ value: string;
253
+ type: "ColorText";
254
+ color: string;
255
+ highlight?: [number, number] | undefined;
256
+ } | {
257
+ value: string;
258
+ type: "BoldText";
259
+ highlight?: [number, number] | undefined;
260
+ } | {
261
+ length: number;
262
+ type: "InlineInput";
263
+ inputType: "string";
264
+ name: string;
265
+ answer?: string | number | undefined;
266
+ } | {
267
+ type: "InlineInput";
268
+ inputType: "numeric";
269
+ name: string;
270
+ digits: number;
271
+ answer?: string | number | undefined;
272
+ })[];
273
+ }[];
274
+ minorTicks?: number | undefined;
275
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
228
276
  } | {
229
277
  type: "TableBlock";
230
278
  cols: number;
@@ -266,6 +314,11 @@ export declare function compileWithAST(dsl: string): {
266
314
  colspan?: number | undefined;
267
315
  }[];
268
316
  }[];
317
+ } | {
318
+ type: "RadioOptions";
319
+ options: string[];
320
+ name: string;
321
+ answer: string;
269
322
  })[];
270
323
  question?: {
271
324
  value: string;
@@ -300,6 +353,9 @@ export declare function compileWithAST(dsl: string): {
300
353
  } | {
301
354
  type: "drag-options";
302
355
  options: string[];
356
+ } | {
357
+ type: "radio-options";
358
+ options: string[];
303
359
  } | {
304
360
  type: "numeric-keypad";
305
361
  includeOperators?: boolean | undefined;
@@ -801,185 +857,31 @@ export declare const ContentBlockSchema: z.ZodUnion<[z.ZodObject<{
801
857
  colspan?: number | undefined;
802
858
  }[];
803
859
  }[];
804
- }>]>;
805
-
806
- /**
807
- * Create a bold text inline element
808
- */
809
- export declare function createBoldText(value: string, highlight?: [number, number]): BoldTextInline;
810
-
811
- /**
812
- * Create a color text inline element
813
- */
814
- export declare function createColorText(value: string, color: string, highlight?: [number, number]): ColorTextInline;
815
-
816
- /**
817
- * Create a drag options tool
818
- */
819
- export declare function createDragOptions(options: string[]): DragOptionsTool;
820
-
821
- /**
822
- * Create an exercise document
823
- */
824
- export declare function createExerciseDocument(question: z.infer<typeof TextBlockSchema> | undefined, lines: ContentBlock[], validation: z.infer<typeof ValidationNodeSchema>, tools?: z.infer<typeof ToolNodeSchema>[]): ExerciseDocument;
825
-
826
- /**
827
- * Create an expression validation node
828
- */
829
- export declare function createExpressionValidation(expression: string): ExpressionValidation;
830
-
831
- /**
832
- * Create a free text inline element
833
- */
834
- export declare function createFreeText(value: string): FreeTextInline;
835
-
836
- /**
837
- * Create a highlighted text inline element
838
- */
839
- export declare function createHighlightedText(value: string, highlight?: [number, number]): HighlightedTextInline;
840
-
841
- /**
842
- * Create a line block
843
- */
844
- export declare function createLineBlock(inlines: InlineNode[]): LineBlock;
845
-
846
- /**
847
- * Create a numeric inline input widget (W_N_I)
848
- */
849
- export declare function createNumericInput(name: string, digits: number, answer?: string | number): InlineInputWidget;
850
-
851
- /**
852
- * Create a numeric keypad tool
853
- */
854
- export declare function createNumericKeypad(includeOperators?: boolean, includeDecimal?: boolean): NumericKeypadTool;
855
-
856
- /**
857
- * Create a simple validation node
858
- */
859
- export declare function createSimpleValidation(): SimpleValidation;
860
-
861
- /**
862
- * Create a space inline element
863
- */
864
- export declare function createSpace(): SpaceInline;
865
-
866
- /**
867
- * Create a string inline input widget (W_S_I)
868
- */
869
- export declare function createStringInput(name: string, length: number, answer?: string | number): InlineInputWidget;
870
-
871
- /**
872
- * Create a text block (question)
873
- */
874
- export declare function createTextBlock(value: string): TextBlock;
875
-
876
- export declare type DragOptionsJSON = z.infer<typeof DragOptionsJSONSchema>;
877
-
878
- export declare const DragOptionsJSONSchema: z.ZodObject<{
879
- type: z.ZodLiteral<"drag-options">;
880
- options: z.ZodArray<z.ZodString, "many">;
881
- }, "strip", z.ZodTypeAny, {
882
- type: "drag-options";
883
- options: string[];
884
- }, {
885
- type: "drag-options";
886
- options: string[];
887
- }>;
888
-
889
- export declare type DragOptionsTool = z.infer<typeof DragOptionsToolSchema>;
890
-
891
- /**
892
- * Drag options tool schema - draggable buttons/options
893
- *
894
- * Common use cases:
895
- * - Comparison symbols: ["<", ">", "="]
896
- * - Yes/No: ["نعم", "لا"]
897
- * - Multiple choice: ["A", "B", "C", "D"]
898
- *
899
- * @example
900
- * {
901
- * type: "DragOptions",
902
- * options: ["<", ">", "="]
903
- * }
904
- */
905
- export declare const DragOptionsToolSchema: z.ZodObject<{
906
- type: z.ZodLiteral<"DragOptions">;
860
+ }>, z.ZodObject<{
861
+ type: z.ZodLiteral<"RadioOptions">;
862
+ name: z.ZodString;
907
863
  options: z.ZodArray<z.ZodString, "many">;
864
+ answer: z.ZodString;
908
865
  }, "strip", z.ZodTypeAny, {
909
- type: "DragOptions";
866
+ type: "RadioOptions";
910
867
  options: string[];
868
+ name: string;
869
+ answer: string;
911
870
  }, {
912
- type: "DragOptions";
871
+ type: "RadioOptions";
913
872
  options: string[];
914
- }>;
915
-
916
- /**
917
- * Base error class for all engine errors
918
- */
919
- export declare class EngineError extends Error {
920
- constructor(message: string);
921
- }
922
-
923
- /**
924
- * Evaluate a mathematical expression with the given variable scope
925
- *
926
- * @param expression - The expression to evaluate (e.g., "(a * b) + (c * d) == 1200")
927
- * @param scope - Variable bindings (e.g., { a: 10, b: 5, c: 20, d: 30 })
928
- * @returns The boolean result of the expression
929
- * @throws Error if evaluation fails
930
- */
931
- export declare function evaluate(expression: string, scope: Record<string, number>): boolean;
932
-
933
- export declare type ExerciseDocument = z.infer<typeof ExerciseDocumentSchema>;
934
-
935
- /**
936
- * Exercise document schema - the complete exercise structure
937
- *
938
- * Structure:
939
- * 1. Question: What the student should do
940
- * 2. Lines: Visual rows with inline elements
941
- * 3. Tools: Standalone interactive elements (optional)
942
- * 4. Validation: How to check answers
943
- *
944
- * @example
945
- * {
946
- * type: "ExerciseDocument",
947
- * question: {
948
- * type: "TextBlock",
949
- * value: "أقارن كل عددين باستعمال الرمر المناسب"
950
- * },
951
- * lines: [
952
- * {
953
- * type: "LineBlock",
954
- * inlines: [
955
- * { type: "HighlightedText", value: "151 000", highlight: [0, 3] },
956
- * { type: "InlineInput", name: "x", length: 1 },
957
- * { type: "HighlightedText", value: "54 000", highlight: [0, 3] }
958
- * ]
959
- * }
960
- * ],
961
- * tools: [
962
- * { type: "DragOptions", options: ["<", ">", "="] }
963
- * ],
964
- * validation: {
965
- * type: "SimpleValidation"
966
- * }
967
- * }
968
- */
969
- export declare const ExerciseDocumentSchema: z.ZodObject<{
970
- type: z.ZodLiteral<"ExerciseDocument">;
971
- question: z.ZodOptional<z.ZodObject<{
972
- type: z.ZodLiteral<"TextBlock">;
973
- value: z.ZodString;
974
- }, "strip", z.ZodTypeAny, {
975
- value: string;
976
- type: "TextBlock";
977
- }, {
978
- value: string;
979
- type: "TextBlock";
980
- }>>;
981
- lines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
982
- type: z.ZodLiteral<"LineBlock">;
873
+ name: string;
874
+ answer: string;
875
+ }>, z.ZodEffects<z.ZodEffects<z.ZodObject<{
876
+ type: z.ZodLiteral<"NumberLineBlock">;
877
+ min: z.ZodNumber;
878
+ max: z.ZodNumber;
879
+ step: z.ZodDefault<z.ZodNumber>;
880
+ minorTicks: z.ZodOptional<z.ZodNumber>;
881
+ style: z.ZodOptional<z.ZodEnum<["arrow-right", "arrow-left", "arrow-both", "line"]>>;
882
+ positions: z.ZodArray<z.ZodObject<{
883
+ type: z.ZodLiteral<"NumberLinePosition">;
884
+ value: z.ZodNumber;
983
885
  inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
984
886
  type: z.ZodLiteral<"FreeText">;
985
887
  value: z.ZodString;
@@ -1072,7 +974,8 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1072
974
  answer?: string | number | undefined;
1073
975
  }>]>]>, "many">;
1074
976
  }, "strip", z.ZodTypeAny, {
1075
- type: "LineBlock";
977
+ value: number;
978
+ type: "NumberLinePosition";
1076
979
  inlines: ({
1077
980
  value: string;
1078
981
  type: "FreeText";
@@ -1105,7 +1008,8 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1105
1008
  answer?: string | number | undefined;
1106
1009
  })[];
1107
1010
  }, {
1108
- type: "LineBlock";
1011
+ value: number;
1012
+ type: "NumberLinePosition";
1109
1013
  inlines: ({
1110
1014
  value: string;
1111
1015
  type: "FreeText";
@@ -1137,44 +1041,633 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1137
1041
  digits: number;
1138
1042
  answer?: string | number | undefined;
1139
1043
  })[];
1140
- }>, z.ZodObject<{
1141
- type: z.ZodLiteral<"TableBlock">;
1142
- cols: z.ZodNumber;
1143
- rows: z.ZodArray<z.ZodObject<{
1144
- type: z.ZodLiteral<"TableRow">;
1145
- cells: z.ZodArray<z.ZodObject<{
1146
- type: z.ZodLiteral<"TableCell">;
1147
- colspan: z.ZodOptional<z.ZodNumber>;
1148
- inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1149
- type: z.ZodLiteral<"FreeText">;
1150
- value: z.ZodString;
1151
- }, "strip", z.ZodTypeAny, {
1152
- value: string;
1153
- type: "FreeText";
1154
- }, {
1155
- value: string;
1156
- type: "FreeText";
1157
- }>, z.ZodObject<{
1158
- type: z.ZodLiteral<"Space">;
1159
- }, "strip", z.ZodTypeAny, {
1160
- type: "Space";
1161
- }, {
1162
- type: "Space";
1163
- }>, z.ZodObject<{
1164
- type: z.ZodLiteral<"HighlightedText">;
1165
- value: z.ZodString;
1166
- highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1167
- }, "strip", z.ZodTypeAny, {
1168
- value: string;
1169
- type: "HighlightedText";
1170
- highlight?: [number, number] | undefined;
1171
- }, {
1172
- value: string;
1173
- type: "HighlightedText";
1174
- highlight?: [number, number] | undefined;
1175
- }>, z.ZodObject<{
1176
- type: z.ZodLiteral<"ColorText">;
1177
- value: z.ZodString;
1044
+ }>, "many">;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ type: "NumberLineBlock";
1047
+ min: number;
1048
+ max: number;
1049
+ step: number;
1050
+ positions: {
1051
+ value: number;
1052
+ type: "NumberLinePosition";
1053
+ inlines: ({
1054
+ value: string;
1055
+ type: "FreeText";
1056
+ } | {
1057
+ type: "Space";
1058
+ } | {
1059
+ value: string;
1060
+ type: "HighlightedText";
1061
+ highlight?: [number, number] | undefined;
1062
+ } | {
1063
+ value: string;
1064
+ type: "ColorText";
1065
+ color: string;
1066
+ highlight?: [number, number] | undefined;
1067
+ } | {
1068
+ value: string;
1069
+ type: "BoldText";
1070
+ highlight?: [number, number] | undefined;
1071
+ } | {
1072
+ length: number;
1073
+ type: "InlineInput";
1074
+ inputType: "string";
1075
+ name: string;
1076
+ answer?: string | number | undefined;
1077
+ } | {
1078
+ type: "InlineInput";
1079
+ inputType: "numeric";
1080
+ name: string;
1081
+ digits: number;
1082
+ answer?: string | number | undefined;
1083
+ })[];
1084
+ }[];
1085
+ minorTicks?: number | undefined;
1086
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1087
+ }, {
1088
+ type: "NumberLineBlock";
1089
+ min: number;
1090
+ max: number;
1091
+ positions: {
1092
+ value: number;
1093
+ type: "NumberLinePosition";
1094
+ inlines: ({
1095
+ value: string;
1096
+ type: "FreeText";
1097
+ } | {
1098
+ type: "Space";
1099
+ } | {
1100
+ value: string;
1101
+ type: "HighlightedText";
1102
+ highlight?: [number, number] | undefined;
1103
+ } | {
1104
+ value: string;
1105
+ type: "ColorText";
1106
+ color: string;
1107
+ highlight?: [number, number] | undefined;
1108
+ } | {
1109
+ value: string;
1110
+ type: "BoldText";
1111
+ highlight?: [number, number] | undefined;
1112
+ } | {
1113
+ length: number;
1114
+ type: "InlineInput";
1115
+ inputType: "string";
1116
+ name: string;
1117
+ answer?: string | number | undefined;
1118
+ } | {
1119
+ type: "InlineInput";
1120
+ inputType: "numeric";
1121
+ name: string;
1122
+ digits: number;
1123
+ answer?: string | number | undefined;
1124
+ })[];
1125
+ }[];
1126
+ step?: number | undefined;
1127
+ minorTicks?: number | undefined;
1128
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1129
+ }>, {
1130
+ type: "NumberLineBlock";
1131
+ min: number;
1132
+ max: number;
1133
+ step: number;
1134
+ positions: {
1135
+ value: number;
1136
+ type: "NumberLinePosition";
1137
+ inlines: ({
1138
+ value: string;
1139
+ type: "FreeText";
1140
+ } | {
1141
+ type: "Space";
1142
+ } | {
1143
+ value: string;
1144
+ type: "HighlightedText";
1145
+ highlight?: [number, number] | undefined;
1146
+ } | {
1147
+ value: string;
1148
+ type: "ColorText";
1149
+ color: string;
1150
+ highlight?: [number, number] | undefined;
1151
+ } | {
1152
+ value: string;
1153
+ type: "BoldText";
1154
+ highlight?: [number, number] | undefined;
1155
+ } | {
1156
+ length: number;
1157
+ type: "InlineInput";
1158
+ inputType: "string";
1159
+ name: string;
1160
+ answer?: string | number | undefined;
1161
+ } | {
1162
+ type: "InlineInput";
1163
+ inputType: "numeric";
1164
+ name: string;
1165
+ digits: number;
1166
+ answer?: string | number | undefined;
1167
+ })[];
1168
+ }[];
1169
+ minorTicks?: number | undefined;
1170
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1171
+ }, {
1172
+ type: "NumberLineBlock";
1173
+ min: number;
1174
+ max: number;
1175
+ positions: {
1176
+ value: number;
1177
+ type: "NumberLinePosition";
1178
+ inlines: ({
1179
+ value: string;
1180
+ type: "FreeText";
1181
+ } | {
1182
+ type: "Space";
1183
+ } | {
1184
+ value: string;
1185
+ type: "HighlightedText";
1186
+ highlight?: [number, number] | undefined;
1187
+ } | {
1188
+ value: string;
1189
+ type: "ColorText";
1190
+ color: string;
1191
+ highlight?: [number, number] | undefined;
1192
+ } | {
1193
+ value: string;
1194
+ type: "BoldText";
1195
+ highlight?: [number, number] | undefined;
1196
+ } | {
1197
+ length: number;
1198
+ type: "InlineInput";
1199
+ inputType: "string";
1200
+ name: string;
1201
+ answer?: string | number | undefined;
1202
+ } | {
1203
+ type: "InlineInput";
1204
+ inputType: "numeric";
1205
+ name: string;
1206
+ digits: number;
1207
+ answer?: string | number | undefined;
1208
+ })[];
1209
+ }[];
1210
+ step?: number | undefined;
1211
+ minorTicks?: number | undefined;
1212
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1213
+ }>, {
1214
+ type: "NumberLineBlock";
1215
+ min: number;
1216
+ max: number;
1217
+ step: number;
1218
+ positions: {
1219
+ value: number;
1220
+ type: "NumberLinePosition";
1221
+ inlines: ({
1222
+ value: string;
1223
+ type: "FreeText";
1224
+ } | {
1225
+ type: "Space";
1226
+ } | {
1227
+ value: string;
1228
+ type: "HighlightedText";
1229
+ highlight?: [number, number] | undefined;
1230
+ } | {
1231
+ value: string;
1232
+ type: "ColorText";
1233
+ color: string;
1234
+ highlight?: [number, number] | undefined;
1235
+ } | {
1236
+ value: string;
1237
+ type: "BoldText";
1238
+ highlight?: [number, number] | undefined;
1239
+ } | {
1240
+ length: number;
1241
+ type: "InlineInput";
1242
+ inputType: "string";
1243
+ name: string;
1244
+ answer?: string | number | undefined;
1245
+ } | {
1246
+ type: "InlineInput";
1247
+ inputType: "numeric";
1248
+ name: string;
1249
+ digits: number;
1250
+ answer?: string | number | undefined;
1251
+ })[];
1252
+ }[];
1253
+ minorTicks?: number | undefined;
1254
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1255
+ }, {
1256
+ type: "NumberLineBlock";
1257
+ min: number;
1258
+ max: number;
1259
+ positions: {
1260
+ value: number;
1261
+ type: "NumberLinePosition";
1262
+ inlines: ({
1263
+ value: string;
1264
+ type: "FreeText";
1265
+ } | {
1266
+ type: "Space";
1267
+ } | {
1268
+ value: string;
1269
+ type: "HighlightedText";
1270
+ highlight?: [number, number] | undefined;
1271
+ } | {
1272
+ value: string;
1273
+ type: "ColorText";
1274
+ color: string;
1275
+ highlight?: [number, number] | undefined;
1276
+ } | {
1277
+ value: string;
1278
+ type: "BoldText";
1279
+ highlight?: [number, number] | undefined;
1280
+ } | {
1281
+ length: number;
1282
+ type: "InlineInput";
1283
+ inputType: "string";
1284
+ name: string;
1285
+ answer?: string | number | undefined;
1286
+ } | {
1287
+ type: "InlineInput";
1288
+ inputType: "numeric";
1289
+ name: string;
1290
+ digits: number;
1291
+ answer?: string | number | undefined;
1292
+ })[];
1293
+ }[];
1294
+ step?: number | undefined;
1295
+ minorTicks?: number | undefined;
1296
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1297
+ }>]>;
1298
+
1299
+ /**
1300
+ * Create a bold text inline element
1301
+ */
1302
+ export declare function createBoldText(value: string, highlight?: [number, number]): BoldTextInline;
1303
+
1304
+ /**
1305
+ * Create a color text inline element
1306
+ */
1307
+ export declare function createColorText(value: string, color: string, highlight?: [number, number]): ColorTextInline;
1308
+
1309
+ /**
1310
+ * Create a drag options tool
1311
+ */
1312
+ export declare function createDragOptions(options: string[]): DragOptionsTool;
1313
+
1314
+ /**
1315
+ * Create an exercise document
1316
+ */
1317
+ export declare function createExerciseDocument(question: z.infer<typeof TextBlockSchema> | undefined, lines: ContentBlock[], validation: z.infer<typeof ValidationNodeSchema>, tools?: z.infer<typeof ToolNodeSchema>[]): ExerciseDocument;
1318
+
1319
+ /**
1320
+ * Create an expression validation node
1321
+ */
1322
+ export declare function createExpressionValidation(expression: string): ExpressionValidation;
1323
+
1324
+ /**
1325
+ * Create a free text inline element
1326
+ */
1327
+ export declare function createFreeText(value: string): FreeTextInline;
1328
+
1329
+ /**
1330
+ * Create a highlighted text inline element
1331
+ */
1332
+ export declare function createHighlightedText(value: string, highlight?: [number, number]): HighlightedTextInline;
1333
+
1334
+ /**
1335
+ * Create a line block
1336
+ */
1337
+ export declare function createLineBlock(inlines: InlineNode[]): LineBlock;
1338
+
1339
+ /**
1340
+ * Create a numeric inline input widget (W_N_I)
1341
+ */
1342
+ export declare function createNumericInput(name: string, digits: number, answer?: string | number): InlineInputWidget;
1343
+
1344
+ /**
1345
+ * Create a numeric keypad tool
1346
+ */
1347
+ export declare function createNumericKeypad(includeOperators?: boolean, includeDecimal?: boolean): NumericKeypadTool;
1348
+
1349
+ /**
1350
+ * Create a simple validation node
1351
+ */
1352
+ export declare function createSimpleValidation(): SimpleValidation;
1353
+
1354
+ /**
1355
+ * Create a space inline element
1356
+ */
1357
+ export declare function createSpace(): SpaceInline;
1358
+
1359
+ /**
1360
+ * Create a string inline input widget (W_S_I)
1361
+ */
1362
+ export declare function createStringInput(name: string, length: number, answer?: string | number): InlineInputWidget;
1363
+
1364
+ /**
1365
+ * Create a text block (question)
1366
+ */
1367
+ export declare function createTextBlock(value: string): TextBlock;
1368
+
1369
+ export declare type DragOptionsJSON = z.infer<typeof DragOptionsJSONSchema>;
1370
+
1371
+ export declare const DragOptionsJSONSchema: z.ZodObject<{
1372
+ type: z.ZodLiteral<"drag-options">;
1373
+ options: z.ZodArray<z.ZodString, "many">;
1374
+ }, "strip", z.ZodTypeAny, {
1375
+ type: "drag-options";
1376
+ options: string[];
1377
+ }, {
1378
+ type: "drag-options";
1379
+ options: string[];
1380
+ }>;
1381
+
1382
+ export declare type DragOptionsTool = z.infer<typeof DragOptionsToolSchema>;
1383
+
1384
+ /**
1385
+ * Drag options tool schema - draggable buttons/options
1386
+ *
1387
+ * Common use cases:
1388
+ * - Comparison symbols: ["<", ">", "="]
1389
+ * - Yes/No: ["نعم", "لا"]
1390
+ * - Multiple choice: ["A", "B", "C", "D"]
1391
+ *
1392
+ * @example
1393
+ * {
1394
+ * type: "DragOptions",
1395
+ * options: ["<", ">", "="]
1396
+ * }
1397
+ */
1398
+ export declare const DragOptionsToolSchema: z.ZodObject<{
1399
+ type: z.ZodLiteral<"DragOptions">;
1400
+ options: z.ZodArray<z.ZodString, "many">;
1401
+ }, "strip", z.ZodTypeAny, {
1402
+ type: "DragOptions";
1403
+ options: string[];
1404
+ }, {
1405
+ type: "DragOptions";
1406
+ options: string[];
1407
+ }>;
1408
+
1409
+ /**
1410
+ * Base error class for all engine errors
1411
+ */
1412
+ export declare class EngineError extends Error {
1413
+ constructor(message: string);
1414
+ }
1415
+
1416
+ /**
1417
+ * Evaluate a mathematical expression with the given variable scope
1418
+ *
1419
+ * @param expression - The expression to evaluate (e.g., "(a * b) + (c * d) == 1200")
1420
+ * @param scope - Variable bindings (e.g., { a: 10, b: 5, c: 20, d: 30 })
1421
+ * @returns The boolean result of the expression
1422
+ * @throws Error if evaluation fails
1423
+ */
1424
+ export declare function evaluate(expression: string, scope: Record<string, number>): boolean;
1425
+
1426
+ export declare type ExerciseDocument = z.infer<typeof ExerciseDocumentSchema>;
1427
+
1428
+ /**
1429
+ * Exercise document schema - the complete exercise structure
1430
+ *
1431
+ * Structure:
1432
+ * 1. Question: What the student should do
1433
+ * 2. Lines: Visual rows with inline elements
1434
+ * 3. Tools: Standalone interactive elements (optional)
1435
+ * 4. Validation: How to check answers
1436
+ *
1437
+ * @example
1438
+ * {
1439
+ * type: "ExerciseDocument",
1440
+ * question: {
1441
+ * type: "TextBlock",
1442
+ * value: "أقارن كل عددين باستعمال الرمر المناسب"
1443
+ * },
1444
+ * lines: [
1445
+ * {
1446
+ * type: "LineBlock",
1447
+ * inlines: [
1448
+ * { type: "HighlightedText", value: "151 000", highlight: [0, 3] },
1449
+ * { type: "InlineInput", name: "x", length: 1 },
1450
+ * { type: "HighlightedText", value: "54 000", highlight: [0, 3] }
1451
+ * ]
1452
+ * }
1453
+ * ],
1454
+ * tools: [
1455
+ * { type: "DragOptions", options: ["<", ">", "="] }
1456
+ * ],
1457
+ * validation: {
1458
+ * type: "SimpleValidation"
1459
+ * }
1460
+ * }
1461
+ */
1462
+ export declare const ExerciseDocumentSchema: z.ZodObject<{
1463
+ type: z.ZodLiteral<"ExerciseDocument">;
1464
+ question: z.ZodOptional<z.ZodObject<{
1465
+ type: z.ZodLiteral<"TextBlock">;
1466
+ value: z.ZodString;
1467
+ }, "strip", z.ZodTypeAny, {
1468
+ value: string;
1469
+ type: "TextBlock";
1470
+ }, {
1471
+ value: string;
1472
+ type: "TextBlock";
1473
+ }>>;
1474
+ lines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1475
+ type: z.ZodLiteral<"LineBlock">;
1476
+ inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1477
+ type: z.ZodLiteral<"FreeText">;
1478
+ value: z.ZodString;
1479
+ }, "strip", z.ZodTypeAny, {
1480
+ value: string;
1481
+ type: "FreeText";
1482
+ }, {
1483
+ value: string;
1484
+ type: "FreeText";
1485
+ }>, z.ZodObject<{
1486
+ type: z.ZodLiteral<"Space">;
1487
+ }, "strip", z.ZodTypeAny, {
1488
+ type: "Space";
1489
+ }, {
1490
+ type: "Space";
1491
+ }>, z.ZodObject<{
1492
+ type: z.ZodLiteral<"HighlightedText">;
1493
+ value: z.ZodString;
1494
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1495
+ }, "strip", z.ZodTypeAny, {
1496
+ value: string;
1497
+ type: "HighlightedText";
1498
+ highlight?: [number, number] | undefined;
1499
+ }, {
1500
+ value: string;
1501
+ type: "HighlightedText";
1502
+ highlight?: [number, number] | undefined;
1503
+ }>, z.ZodObject<{
1504
+ type: z.ZodLiteral<"ColorText">;
1505
+ value: z.ZodString;
1506
+ color: z.ZodString;
1507
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1508
+ }, "strip", z.ZodTypeAny, {
1509
+ value: string;
1510
+ type: "ColorText";
1511
+ color: string;
1512
+ highlight?: [number, number] | undefined;
1513
+ }, {
1514
+ value: string;
1515
+ type: "ColorText";
1516
+ color: string;
1517
+ highlight?: [number, number] | undefined;
1518
+ }>, z.ZodObject<{
1519
+ type: z.ZodLiteral<"BoldText">;
1520
+ value: z.ZodString;
1521
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1522
+ }, "strip", z.ZodTypeAny, {
1523
+ value: string;
1524
+ type: "BoldText";
1525
+ highlight?: [number, number] | undefined;
1526
+ }, {
1527
+ value: string;
1528
+ type: "BoldText";
1529
+ highlight?: [number, number] | undefined;
1530
+ }>, z.ZodDiscriminatedUnion<"inputType", [z.ZodObject<{
1531
+ type: z.ZodLiteral<"InlineInput">;
1532
+ name: z.ZodString;
1533
+ inputType: z.ZodLiteral<"string">;
1534
+ length: z.ZodNumber;
1535
+ answer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1536
+ }, "strip", z.ZodTypeAny, {
1537
+ length: number;
1538
+ type: "InlineInput";
1539
+ inputType: "string";
1540
+ name: string;
1541
+ answer?: string | number | undefined;
1542
+ }, {
1543
+ length: number;
1544
+ type: "InlineInput";
1545
+ inputType: "string";
1546
+ name: string;
1547
+ answer?: string | number | undefined;
1548
+ }>, z.ZodObject<{
1549
+ type: z.ZodLiteral<"InlineInput">;
1550
+ name: z.ZodString;
1551
+ inputType: z.ZodLiteral<"numeric">;
1552
+ digits: z.ZodNumber;
1553
+ answer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1554
+ }, "strip", z.ZodTypeAny, {
1555
+ type: "InlineInput";
1556
+ inputType: "numeric";
1557
+ name: string;
1558
+ digits: number;
1559
+ answer?: string | number | undefined;
1560
+ }, {
1561
+ type: "InlineInput";
1562
+ inputType: "numeric";
1563
+ name: string;
1564
+ digits: number;
1565
+ answer?: string | number | undefined;
1566
+ }>]>]>, "many">;
1567
+ }, "strip", z.ZodTypeAny, {
1568
+ type: "LineBlock";
1569
+ inlines: ({
1570
+ value: string;
1571
+ type: "FreeText";
1572
+ } | {
1573
+ type: "Space";
1574
+ } | {
1575
+ value: string;
1576
+ type: "HighlightedText";
1577
+ highlight?: [number, number] | undefined;
1578
+ } | {
1579
+ value: string;
1580
+ type: "ColorText";
1581
+ color: string;
1582
+ highlight?: [number, number] | undefined;
1583
+ } | {
1584
+ value: string;
1585
+ type: "BoldText";
1586
+ highlight?: [number, number] | undefined;
1587
+ } | {
1588
+ length: number;
1589
+ type: "InlineInput";
1590
+ inputType: "string";
1591
+ name: string;
1592
+ answer?: string | number | undefined;
1593
+ } | {
1594
+ type: "InlineInput";
1595
+ inputType: "numeric";
1596
+ name: string;
1597
+ digits: number;
1598
+ answer?: string | number | undefined;
1599
+ })[];
1600
+ }, {
1601
+ type: "LineBlock";
1602
+ inlines: ({
1603
+ value: string;
1604
+ type: "FreeText";
1605
+ } | {
1606
+ type: "Space";
1607
+ } | {
1608
+ value: string;
1609
+ type: "HighlightedText";
1610
+ highlight?: [number, number] | undefined;
1611
+ } | {
1612
+ value: string;
1613
+ type: "ColorText";
1614
+ color: string;
1615
+ highlight?: [number, number] | undefined;
1616
+ } | {
1617
+ value: string;
1618
+ type: "BoldText";
1619
+ highlight?: [number, number] | undefined;
1620
+ } | {
1621
+ length: number;
1622
+ type: "InlineInput";
1623
+ inputType: "string";
1624
+ name: string;
1625
+ answer?: string | number | undefined;
1626
+ } | {
1627
+ type: "InlineInput";
1628
+ inputType: "numeric";
1629
+ name: string;
1630
+ digits: number;
1631
+ answer?: string | number | undefined;
1632
+ })[];
1633
+ }>, z.ZodObject<{
1634
+ type: z.ZodLiteral<"TableBlock">;
1635
+ cols: z.ZodNumber;
1636
+ rows: z.ZodArray<z.ZodObject<{
1637
+ type: z.ZodLiteral<"TableRow">;
1638
+ cells: z.ZodArray<z.ZodObject<{
1639
+ type: z.ZodLiteral<"TableCell">;
1640
+ colspan: z.ZodOptional<z.ZodNumber>;
1641
+ inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1642
+ type: z.ZodLiteral<"FreeText">;
1643
+ value: z.ZodString;
1644
+ }, "strip", z.ZodTypeAny, {
1645
+ value: string;
1646
+ type: "FreeText";
1647
+ }, {
1648
+ value: string;
1649
+ type: "FreeText";
1650
+ }>, z.ZodObject<{
1651
+ type: z.ZodLiteral<"Space">;
1652
+ }, "strip", z.ZodTypeAny, {
1653
+ type: "Space";
1654
+ }, {
1655
+ type: "Space";
1656
+ }>, z.ZodObject<{
1657
+ type: z.ZodLiteral<"HighlightedText">;
1658
+ value: z.ZodString;
1659
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ value: string;
1662
+ type: "HighlightedText";
1663
+ highlight?: [number, number] | undefined;
1664
+ }, {
1665
+ value: string;
1666
+ type: "HighlightedText";
1667
+ highlight?: [number, number] | undefined;
1668
+ }>, z.ZodObject<{
1669
+ type: z.ZodLiteral<"ColorText">;
1670
+ value: z.ZodString;
1178
1671
  color: z.ZodString;
1179
1672
  highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1180
1673
  }, "strip", z.ZodTypeAny, {
@@ -1343,125 +1836,562 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1343
1836
  colspan?: number | undefined;
1344
1837
  }[];
1345
1838
  }, {
1346
- type: "TableRow";
1347
- cells: {
1348
- type: "TableCell";
1349
- inlines: ({
1350
- value: string;
1351
- type: "FreeText";
1352
- } | {
1353
- type: "Space";
1354
- } | {
1355
- value: string;
1356
- type: "HighlightedText";
1357
- highlight?: [number, number] | undefined;
1358
- } | {
1359
- value: string;
1360
- type: "ColorText";
1361
- color: string;
1362
- highlight?: [number, number] | undefined;
1363
- } | {
1364
- value: string;
1365
- type: "BoldText";
1366
- highlight?: [number, number] | undefined;
1367
- } | {
1368
- length: number;
1369
- type: "InlineInput";
1370
- inputType: "string";
1371
- name: string;
1372
- answer?: string | number | undefined;
1373
- } | {
1374
- type: "InlineInput";
1375
- inputType: "numeric";
1376
- name: string;
1377
- digits: number;
1378
- answer?: string | number | undefined;
1379
- })[];
1380
- colspan?: number | undefined;
1381
- }[];
1839
+ type: "TableRow";
1840
+ cells: {
1841
+ type: "TableCell";
1842
+ inlines: ({
1843
+ value: string;
1844
+ type: "FreeText";
1845
+ } | {
1846
+ type: "Space";
1847
+ } | {
1848
+ value: string;
1849
+ type: "HighlightedText";
1850
+ highlight?: [number, number] | undefined;
1851
+ } | {
1852
+ value: string;
1853
+ type: "ColorText";
1854
+ color: string;
1855
+ highlight?: [number, number] | undefined;
1856
+ } | {
1857
+ value: string;
1858
+ type: "BoldText";
1859
+ highlight?: [number, number] | undefined;
1860
+ } | {
1861
+ length: number;
1862
+ type: "InlineInput";
1863
+ inputType: "string";
1864
+ name: string;
1865
+ answer?: string | number | undefined;
1866
+ } | {
1867
+ type: "InlineInput";
1868
+ inputType: "numeric";
1869
+ name: string;
1870
+ digits: number;
1871
+ answer?: string | number | undefined;
1872
+ })[];
1873
+ colspan?: number | undefined;
1874
+ }[];
1875
+ }>, "many">;
1876
+ }, "strip", z.ZodTypeAny, {
1877
+ type: "TableBlock";
1878
+ cols: number;
1879
+ rows: {
1880
+ type: "TableRow";
1881
+ cells: {
1882
+ type: "TableCell";
1883
+ inlines: ({
1884
+ value: string;
1885
+ type: "FreeText";
1886
+ } | {
1887
+ type: "Space";
1888
+ } | {
1889
+ value: string;
1890
+ type: "HighlightedText";
1891
+ highlight?: [number, number] | undefined;
1892
+ } | {
1893
+ value: string;
1894
+ type: "ColorText";
1895
+ color: string;
1896
+ highlight?: [number, number] | undefined;
1897
+ } | {
1898
+ value: string;
1899
+ type: "BoldText";
1900
+ highlight?: [number, number] | undefined;
1901
+ } | {
1902
+ length: number;
1903
+ type: "InlineInput";
1904
+ inputType: "string";
1905
+ name: string;
1906
+ answer?: string | number | undefined;
1907
+ } | {
1908
+ type: "InlineInput";
1909
+ inputType: "numeric";
1910
+ name: string;
1911
+ digits: number;
1912
+ answer?: string | number | undefined;
1913
+ })[];
1914
+ colspan?: number | undefined;
1915
+ }[];
1916
+ }[];
1917
+ }, {
1918
+ type: "TableBlock";
1919
+ cols: number;
1920
+ rows: {
1921
+ type: "TableRow";
1922
+ cells: {
1923
+ type: "TableCell";
1924
+ inlines: ({
1925
+ value: string;
1926
+ type: "FreeText";
1927
+ } | {
1928
+ type: "Space";
1929
+ } | {
1930
+ value: string;
1931
+ type: "HighlightedText";
1932
+ highlight?: [number, number] | undefined;
1933
+ } | {
1934
+ value: string;
1935
+ type: "ColorText";
1936
+ color: string;
1937
+ highlight?: [number, number] | undefined;
1938
+ } | {
1939
+ value: string;
1940
+ type: "BoldText";
1941
+ highlight?: [number, number] | undefined;
1942
+ } | {
1943
+ length: number;
1944
+ type: "InlineInput";
1945
+ inputType: "string";
1946
+ name: string;
1947
+ answer?: string | number | undefined;
1948
+ } | {
1949
+ type: "InlineInput";
1950
+ inputType: "numeric";
1951
+ name: string;
1952
+ digits: number;
1953
+ answer?: string | number | undefined;
1954
+ })[];
1955
+ colspan?: number | undefined;
1956
+ }[];
1957
+ }[];
1958
+ }>, z.ZodObject<{
1959
+ type: z.ZodLiteral<"RadioOptions">;
1960
+ name: z.ZodString;
1961
+ options: z.ZodArray<z.ZodString, "many">;
1962
+ answer: z.ZodString;
1963
+ }, "strip", z.ZodTypeAny, {
1964
+ type: "RadioOptions";
1965
+ options: string[];
1966
+ name: string;
1967
+ answer: string;
1968
+ }, {
1969
+ type: "RadioOptions";
1970
+ options: string[];
1971
+ name: string;
1972
+ answer: string;
1973
+ }>, z.ZodEffects<z.ZodEffects<z.ZodObject<{
1974
+ type: z.ZodLiteral<"NumberLineBlock">;
1975
+ min: z.ZodNumber;
1976
+ max: z.ZodNumber;
1977
+ step: z.ZodDefault<z.ZodNumber>;
1978
+ minorTicks: z.ZodOptional<z.ZodNumber>;
1979
+ style: z.ZodOptional<z.ZodEnum<["arrow-right", "arrow-left", "arrow-both", "line"]>>;
1980
+ positions: z.ZodArray<z.ZodObject<{
1981
+ type: z.ZodLiteral<"NumberLinePosition">;
1982
+ value: z.ZodNumber;
1983
+ inlines: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1984
+ type: z.ZodLiteral<"FreeText">;
1985
+ value: z.ZodString;
1986
+ }, "strip", z.ZodTypeAny, {
1987
+ value: string;
1988
+ type: "FreeText";
1989
+ }, {
1990
+ value: string;
1991
+ type: "FreeText";
1992
+ }>, z.ZodObject<{
1993
+ type: z.ZodLiteral<"Space">;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ type: "Space";
1996
+ }, {
1997
+ type: "Space";
1998
+ }>, z.ZodObject<{
1999
+ type: z.ZodLiteral<"HighlightedText">;
2000
+ value: z.ZodString;
2001
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
2002
+ }, "strip", z.ZodTypeAny, {
2003
+ value: string;
2004
+ type: "HighlightedText";
2005
+ highlight?: [number, number] | undefined;
2006
+ }, {
2007
+ value: string;
2008
+ type: "HighlightedText";
2009
+ highlight?: [number, number] | undefined;
2010
+ }>, z.ZodObject<{
2011
+ type: z.ZodLiteral<"ColorText">;
2012
+ value: z.ZodString;
2013
+ color: z.ZodString;
2014
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
2015
+ }, "strip", z.ZodTypeAny, {
2016
+ value: string;
2017
+ type: "ColorText";
2018
+ color: string;
2019
+ highlight?: [number, number] | undefined;
2020
+ }, {
2021
+ value: string;
2022
+ type: "ColorText";
2023
+ color: string;
2024
+ highlight?: [number, number] | undefined;
2025
+ }>, z.ZodObject<{
2026
+ type: z.ZodLiteral<"BoldText">;
2027
+ value: z.ZodString;
2028
+ highlight: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
2029
+ }, "strip", z.ZodTypeAny, {
2030
+ value: string;
2031
+ type: "BoldText";
2032
+ highlight?: [number, number] | undefined;
2033
+ }, {
2034
+ value: string;
2035
+ type: "BoldText";
2036
+ highlight?: [number, number] | undefined;
2037
+ }>, z.ZodDiscriminatedUnion<"inputType", [z.ZodObject<{
2038
+ type: z.ZodLiteral<"InlineInput">;
2039
+ name: z.ZodString;
2040
+ inputType: z.ZodLiteral<"string">;
2041
+ length: z.ZodNumber;
2042
+ answer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2043
+ }, "strip", z.ZodTypeAny, {
2044
+ length: number;
2045
+ type: "InlineInput";
2046
+ inputType: "string";
2047
+ name: string;
2048
+ answer?: string | number | undefined;
2049
+ }, {
2050
+ length: number;
2051
+ type: "InlineInput";
2052
+ inputType: "string";
2053
+ name: string;
2054
+ answer?: string | number | undefined;
2055
+ }>, z.ZodObject<{
2056
+ type: z.ZodLiteral<"InlineInput">;
2057
+ name: z.ZodString;
2058
+ inputType: z.ZodLiteral<"numeric">;
2059
+ digits: z.ZodNumber;
2060
+ answer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2061
+ }, "strip", z.ZodTypeAny, {
2062
+ type: "InlineInput";
2063
+ inputType: "numeric";
2064
+ name: string;
2065
+ digits: number;
2066
+ answer?: string | number | undefined;
2067
+ }, {
2068
+ type: "InlineInput";
2069
+ inputType: "numeric";
2070
+ name: string;
2071
+ digits: number;
2072
+ answer?: string | number | undefined;
2073
+ }>]>]>, "many">;
2074
+ }, "strip", z.ZodTypeAny, {
2075
+ value: number;
2076
+ type: "NumberLinePosition";
2077
+ inlines: ({
2078
+ value: string;
2079
+ type: "FreeText";
2080
+ } | {
2081
+ type: "Space";
2082
+ } | {
2083
+ value: string;
2084
+ type: "HighlightedText";
2085
+ highlight?: [number, number] | undefined;
2086
+ } | {
2087
+ value: string;
2088
+ type: "ColorText";
2089
+ color: string;
2090
+ highlight?: [number, number] | undefined;
2091
+ } | {
2092
+ value: string;
2093
+ type: "BoldText";
2094
+ highlight?: [number, number] | undefined;
2095
+ } | {
2096
+ length: number;
2097
+ type: "InlineInput";
2098
+ inputType: "string";
2099
+ name: string;
2100
+ answer?: string | number | undefined;
2101
+ } | {
2102
+ type: "InlineInput";
2103
+ inputType: "numeric";
2104
+ name: string;
2105
+ digits: number;
2106
+ answer?: string | number | undefined;
2107
+ })[];
2108
+ }, {
2109
+ value: number;
2110
+ type: "NumberLinePosition";
2111
+ inlines: ({
2112
+ value: string;
2113
+ type: "FreeText";
2114
+ } | {
2115
+ type: "Space";
2116
+ } | {
2117
+ value: string;
2118
+ type: "HighlightedText";
2119
+ highlight?: [number, number] | undefined;
2120
+ } | {
2121
+ value: string;
2122
+ type: "ColorText";
2123
+ color: string;
2124
+ highlight?: [number, number] | undefined;
2125
+ } | {
2126
+ value: string;
2127
+ type: "BoldText";
2128
+ highlight?: [number, number] | undefined;
2129
+ } | {
2130
+ length: number;
2131
+ type: "InlineInput";
2132
+ inputType: "string";
2133
+ name: string;
2134
+ answer?: string | number | undefined;
2135
+ } | {
2136
+ type: "InlineInput";
2137
+ inputType: "numeric";
2138
+ name: string;
2139
+ digits: number;
2140
+ answer?: string | number | undefined;
2141
+ })[];
1382
2142
  }>, "many">;
1383
2143
  }, "strip", z.ZodTypeAny, {
1384
- type: "TableBlock";
1385
- cols: number;
1386
- rows: {
1387
- type: "TableRow";
1388
- cells: {
1389
- type: "TableCell";
1390
- inlines: ({
1391
- value: string;
1392
- type: "FreeText";
1393
- } | {
1394
- type: "Space";
1395
- } | {
1396
- value: string;
1397
- type: "HighlightedText";
1398
- highlight?: [number, number] | undefined;
1399
- } | {
1400
- value: string;
1401
- type: "ColorText";
1402
- color: string;
1403
- highlight?: [number, number] | undefined;
1404
- } | {
1405
- value: string;
1406
- type: "BoldText";
1407
- highlight?: [number, number] | undefined;
1408
- } | {
1409
- length: number;
1410
- type: "InlineInput";
1411
- inputType: "string";
1412
- name: string;
1413
- answer?: string | number | undefined;
1414
- } | {
1415
- type: "InlineInput";
1416
- inputType: "numeric";
1417
- name: string;
1418
- digits: number;
1419
- answer?: string | number | undefined;
1420
- })[];
1421
- colspan?: number | undefined;
1422
- }[];
2144
+ type: "NumberLineBlock";
2145
+ min: number;
2146
+ max: number;
2147
+ step: number;
2148
+ positions: {
2149
+ value: number;
2150
+ type: "NumberLinePosition";
2151
+ inlines: ({
2152
+ value: string;
2153
+ type: "FreeText";
2154
+ } | {
2155
+ type: "Space";
2156
+ } | {
2157
+ value: string;
2158
+ type: "HighlightedText";
2159
+ highlight?: [number, number] | undefined;
2160
+ } | {
2161
+ value: string;
2162
+ type: "ColorText";
2163
+ color: string;
2164
+ highlight?: [number, number] | undefined;
2165
+ } | {
2166
+ value: string;
2167
+ type: "BoldText";
2168
+ highlight?: [number, number] | undefined;
2169
+ } | {
2170
+ length: number;
2171
+ type: "InlineInput";
2172
+ inputType: "string";
2173
+ name: string;
2174
+ answer?: string | number | undefined;
2175
+ } | {
2176
+ type: "InlineInput";
2177
+ inputType: "numeric";
2178
+ name: string;
2179
+ digits: number;
2180
+ answer?: string | number | undefined;
2181
+ })[];
2182
+ }[];
2183
+ minorTicks?: number | undefined;
2184
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
2185
+ }, {
2186
+ type: "NumberLineBlock";
2187
+ min: number;
2188
+ max: number;
2189
+ positions: {
2190
+ value: number;
2191
+ type: "NumberLinePosition";
2192
+ inlines: ({
2193
+ value: string;
2194
+ type: "FreeText";
2195
+ } | {
2196
+ type: "Space";
2197
+ } | {
2198
+ value: string;
2199
+ type: "HighlightedText";
2200
+ highlight?: [number, number] | undefined;
2201
+ } | {
2202
+ value: string;
2203
+ type: "ColorText";
2204
+ color: string;
2205
+ highlight?: [number, number] | undefined;
2206
+ } | {
2207
+ value: string;
2208
+ type: "BoldText";
2209
+ highlight?: [number, number] | undefined;
2210
+ } | {
2211
+ length: number;
2212
+ type: "InlineInput";
2213
+ inputType: "string";
2214
+ name: string;
2215
+ answer?: string | number | undefined;
2216
+ } | {
2217
+ type: "InlineInput";
2218
+ inputType: "numeric";
2219
+ name: string;
2220
+ digits: number;
2221
+ answer?: string | number | undefined;
2222
+ })[];
2223
+ }[];
2224
+ step?: number | undefined;
2225
+ minorTicks?: number | undefined;
2226
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
2227
+ }>, {
2228
+ type: "NumberLineBlock";
2229
+ min: number;
2230
+ max: number;
2231
+ step: number;
2232
+ positions: {
2233
+ value: number;
2234
+ type: "NumberLinePosition";
2235
+ inlines: ({
2236
+ value: string;
2237
+ type: "FreeText";
2238
+ } | {
2239
+ type: "Space";
2240
+ } | {
2241
+ value: string;
2242
+ type: "HighlightedText";
2243
+ highlight?: [number, number] | undefined;
2244
+ } | {
2245
+ value: string;
2246
+ type: "ColorText";
2247
+ color: string;
2248
+ highlight?: [number, number] | undefined;
2249
+ } | {
2250
+ value: string;
2251
+ type: "BoldText";
2252
+ highlight?: [number, number] | undefined;
2253
+ } | {
2254
+ length: number;
2255
+ type: "InlineInput";
2256
+ inputType: "string";
2257
+ name: string;
2258
+ answer?: string | number | undefined;
2259
+ } | {
2260
+ type: "InlineInput";
2261
+ inputType: "numeric";
2262
+ name: string;
2263
+ digits: number;
2264
+ answer?: string | number | undefined;
2265
+ })[];
2266
+ }[];
2267
+ minorTicks?: number | undefined;
2268
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
2269
+ }, {
2270
+ type: "NumberLineBlock";
2271
+ min: number;
2272
+ max: number;
2273
+ positions: {
2274
+ value: number;
2275
+ type: "NumberLinePosition";
2276
+ inlines: ({
2277
+ value: string;
2278
+ type: "FreeText";
2279
+ } | {
2280
+ type: "Space";
2281
+ } | {
2282
+ value: string;
2283
+ type: "HighlightedText";
2284
+ highlight?: [number, number] | undefined;
2285
+ } | {
2286
+ value: string;
2287
+ type: "ColorText";
2288
+ color: string;
2289
+ highlight?: [number, number] | undefined;
2290
+ } | {
2291
+ value: string;
2292
+ type: "BoldText";
2293
+ highlight?: [number, number] | undefined;
2294
+ } | {
2295
+ length: number;
2296
+ type: "InlineInput";
2297
+ inputType: "string";
2298
+ name: string;
2299
+ answer?: string | number | undefined;
2300
+ } | {
2301
+ type: "InlineInput";
2302
+ inputType: "numeric";
2303
+ name: string;
2304
+ digits: number;
2305
+ answer?: string | number | undefined;
2306
+ })[];
2307
+ }[];
2308
+ step?: number | undefined;
2309
+ minorTicks?: number | undefined;
2310
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
2311
+ }>, {
2312
+ type: "NumberLineBlock";
2313
+ min: number;
2314
+ max: number;
2315
+ step: number;
2316
+ positions: {
2317
+ value: number;
2318
+ type: "NumberLinePosition";
2319
+ inlines: ({
2320
+ value: string;
2321
+ type: "FreeText";
2322
+ } | {
2323
+ type: "Space";
2324
+ } | {
2325
+ value: string;
2326
+ type: "HighlightedText";
2327
+ highlight?: [number, number] | undefined;
2328
+ } | {
2329
+ value: string;
2330
+ type: "ColorText";
2331
+ color: string;
2332
+ highlight?: [number, number] | undefined;
2333
+ } | {
2334
+ value: string;
2335
+ type: "BoldText";
2336
+ highlight?: [number, number] | undefined;
2337
+ } | {
2338
+ length: number;
2339
+ type: "InlineInput";
2340
+ inputType: "string";
2341
+ name: string;
2342
+ answer?: string | number | undefined;
2343
+ } | {
2344
+ type: "InlineInput";
2345
+ inputType: "numeric";
2346
+ name: string;
2347
+ digits: number;
2348
+ answer?: string | number | undefined;
2349
+ })[];
1423
2350
  }[];
2351
+ minorTicks?: number | undefined;
2352
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1424
2353
  }, {
1425
- type: "TableBlock";
1426
- cols: number;
1427
- rows: {
1428
- type: "TableRow";
1429
- cells: {
1430
- type: "TableCell";
1431
- inlines: ({
1432
- value: string;
1433
- type: "FreeText";
1434
- } | {
1435
- type: "Space";
1436
- } | {
1437
- value: string;
1438
- type: "HighlightedText";
1439
- highlight?: [number, number] | undefined;
1440
- } | {
1441
- value: string;
1442
- type: "ColorText";
1443
- color: string;
1444
- highlight?: [number, number] | undefined;
1445
- } | {
1446
- value: string;
1447
- type: "BoldText";
1448
- highlight?: [number, number] | undefined;
1449
- } | {
1450
- length: number;
1451
- type: "InlineInput";
1452
- inputType: "string";
1453
- name: string;
1454
- answer?: string | number | undefined;
1455
- } | {
1456
- type: "InlineInput";
1457
- inputType: "numeric";
1458
- name: string;
1459
- digits: number;
1460
- answer?: string | number | undefined;
1461
- })[];
1462
- colspan?: number | undefined;
1463
- }[];
2354
+ type: "NumberLineBlock";
2355
+ min: number;
2356
+ max: number;
2357
+ positions: {
2358
+ value: number;
2359
+ type: "NumberLinePosition";
2360
+ inlines: ({
2361
+ value: string;
2362
+ type: "FreeText";
2363
+ } | {
2364
+ type: "Space";
2365
+ } | {
2366
+ value: string;
2367
+ type: "HighlightedText";
2368
+ highlight?: [number, number] | undefined;
2369
+ } | {
2370
+ value: string;
2371
+ type: "ColorText";
2372
+ color: string;
2373
+ highlight?: [number, number] | undefined;
2374
+ } | {
2375
+ value: string;
2376
+ type: "BoldText";
2377
+ highlight?: [number, number] | undefined;
2378
+ } | {
2379
+ length: number;
2380
+ type: "InlineInput";
2381
+ inputType: "string";
2382
+ name: string;
2383
+ answer?: string | number | undefined;
2384
+ } | {
2385
+ type: "InlineInput";
2386
+ inputType: "numeric";
2387
+ name: string;
2388
+ digits: number;
2389
+ answer?: string | number | undefined;
2390
+ })[];
1464
2391
  }[];
2392
+ step?: number | undefined;
2393
+ minorTicks?: number | undefined;
2394
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1465
2395
  }>]>, "many">;
1466
2396
  tools: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1467
2397
  type: z.ZodLiteral<"DragOptions">;
@@ -1542,6 +2472,48 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1542
2472
  digits: number;
1543
2473
  answer?: string | number | undefined;
1544
2474
  })[];
2475
+ } | {
2476
+ type: "NumberLineBlock";
2477
+ min: number;
2478
+ max: number;
2479
+ step: number;
2480
+ positions: {
2481
+ value: number;
2482
+ type: "NumberLinePosition";
2483
+ inlines: ({
2484
+ value: string;
2485
+ type: "FreeText";
2486
+ } | {
2487
+ type: "Space";
2488
+ } | {
2489
+ value: string;
2490
+ type: "HighlightedText";
2491
+ highlight?: [number, number] | undefined;
2492
+ } | {
2493
+ value: string;
2494
+ type: "ColorText";
2495
+ color: string;
2496
+ highlight?: [number, number] | undefined;
2497
+ } | {
2498
+ value: string;
2499
+ type: "BoldText";
2500
+ highlight?: [number, number] | undefined;
2501
+ } | {
2502
+ length: number;
2503
+ type: "InlineInput";
2504
+ inputType: "string";
2505
+ name: string;
2506
+ answer?: string | number | undefined;
2507
+ } | {
2508
+ type: "InlineInput";
2509
+ inputType: "numeric";
2510
+ name: string;
2511
+ digits: number;
2512
+ answer?: string | number | undefined;
2513
+ })[];
2514
+ }[];
2515
+ minorTicks?: number | undefined;
2516
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1545
2517
  } | {
1546
2518
  type: "TableBlock";
1547
2519
  cols: number;
@@ -1583,6 +2555,11 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1583
2555
  colspan?: number | undefined;
1584
2556
  }[];
1585
2557
  }[];
2558
+ } | {
2559
+ type: "RadioOptions";
2560
+ options: string[];
2561
+ name: string;
2562
+ answer: string;
1586
2563
  })[];
1587
2564
  question?: {
1588
2565
  value: string;
@@ -1637,6 +2614,48 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1637
2614
  digits: number;
1638
2615
  answer?: string | number | undefined;
1639
2616
  })[];
2617
+ } | {
2618
+ type: "NumberLineBlock";
2619
+ min: number;
2620
+ max: number;
2621
+ positions: {
2622
+ value: number;
2623
+ type: "NumberLinePosition";
2624
+ inlines: ({
2625
+ value: string;
2626
+ type: "FreeText";
2627
+ } | {
2628
+ type: "Space";
2629
+ } | {
2630
+ value: string;
2631
+ type: "HighlightedText";
2632
+ highlight?: [number, number] | undefined;
2633
+ } | {
2634
+ value: string;
2635
+ type: "ColorText";
2636
+ color: string;
2637
+ highlight?: [number, number] | undefined;
2638
+ } | {
2639
+ value: string;
2640
+ type: "BoldText";
2641
+ highlight?: [number, number] | undefined;
2642
+ } | {
2643
+ length: number;
2644
+ type: "InlineInput";
2645
+ inputType: "string";
2646
+ name: string;
2647
+ answer?: string | number | undefined;
2648
+ } | {
2649
+ type: "InlineInput";
2650
+ inputType: "numeric";
2651
+ name: string;
2652
+ digits: number;
2653
+ answer?: string | number | undefined;
2654
+ })[];
2655
+ }[];
2656
+ step?: number | undefined;
2657
+ minorTicks?: number | undefined;
2658
+ style?: "arrow-right" | "arrow-left" | "arrow-both" | "line" | undefined;
1640
2659
  } | {
1641
2660
  type: "TableBlock";
1642
2661
  cols: number;
@@ -1678,6 +2697,11 @@ export declare const ExerciseDocumentSchema: z.ZodObject<{
1678
2697
  colspan?: number | undefined;
1679
2698
  }[];
1680
2699
  }[];
2700
+ } | {
2701
+ type: "RadioOptions";
2702
+ options: string[];
2703
+ name: string;
2704
+ answer: string;
1681
2705
  })[];
1682
2706
  question?: {
1683
2707
  value: string;
@@ -1732,6 +2756,15 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
1732
2756
  }, {
1733
2757
  type: "drag-options";
1734
2758
  options: string[];
2759
+ }>, z.ZodObject<{
2760
+ type: z.ZodLiteral<"radio-options">;
2761
+ options: z.ZodArray<z.ZodString, "many">;
2762
+ }, "strip", z.ZodTypeAny, {
2763
+ type: "radio-options";
2764
+ options: string[];
2765
+ }, {
2766
+ type: "radio-options";
2767
+ options: string[];
1735
2768
  }>, z.ZodObject<{
1736
2769
  type: z.ZodLiteral<"numeric-keypad">;
1737
2770
  includeOperators: z.ZodOptional<z.ZodBoolean>;
@@ -1797,6 +2830,9 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
1797
2830
  } | {
1798
2831
  type: "drag-options";
1799
2832
  options: string[];
2833
+ } | {
2834
+ type: "radio-options";
2835
+ options: string[];
1800
2836
  } | {
1801
2837
  type: "numeric-keypad";
1802
2838
  includeOperators?: boolean | undefined;
@@ -1829,6 +2865,9 @@ export declare const ExerciseJSONSchema: z.ZodObject<{
1829
2865
  } | {
1830
2866
  type: "drag-options";
1831
2867
  options: string[];
2868
+ } | {
2869
+ type: "radio-options";
2870
+ options: string[];
1832
2871
  } | {
1833
2872
  type: "numeric-keypad";
1834
2873
  includeOperators?: boolean | undefined;
@@ -2302,6 +3341,13 @@ export declare function isQuestionText(item: LayoutItem): item is Extract<Layout
2302
3341
  type: 'question-text';
2303
3342
  }>;
2304
3343
 
3344
+ /**
3345
+ * Type guard for RadioOptionsJSON
3346
+ */
3347
+ export declare function isRadioOptionsJSON(widget: WidgetJSON): widget is Extract<WidgetJSON, {
3348
+ type: 'radio-options';
3349
+ }>;
3350
+
2305
3351
  export declare function isSimpleValidation(value: unknown): value is SimpleValidation;
2306
3352
 
2307
3353
  export declare function isSpace(value: unknown): value is SpaceInline;
@@ -2394,10 +3440,16 @@ export declare const JSON_TYPES: {
2394
3440
  readonly TABLE_ROW: "table-row";
2395
3441
  /** Cell within a table */
2396
3442
  readonly TABLE_CELL: "table-cell";
3443
+ /** Number line layout block */
3444
+ readonly NUMBER_LINE: "number-line";
3445
+ /** Position marker within a number line */
3446
+ readonly NUMBER_LINE_POSITION: "number-line-position";
2397
3447
  /** Inline input widget (string or numeric) */
2398
3448
  readonly INLINE_INPUT: "inline-input";
2399
3449
  /** Drag-and-drop options widget */
2400
3450
  readonly DRAG_OPTIONS: "drag-options";
3451
+ /** Radio button options widget */
3452
+ readonly RADIO_OPTIONS: "radio-options";
2401
3453
  /** Numeric keypad widget */
2402
3454
  readonly NUMERIC_KEYPAD: "numeric-keypad";
2403
3455
  };
@@ -2421,7 +3473,7 @@ export declare interface LayoutRendererProps {
2421
3473
  widgets: Record<string, WidgetJSON>;
2422
3474
  values: Record<string, string>;
2423
3475
  droppedInputs: Set<string>;
2424
- onChange: (widgetId: string, value: string, fromDrop?: boolean) => void;
3476
+ onChange: (widgetId: string, value: string, fromDrop?: boolean, sourceOptionId?: string) => void;
2425
3477
  onInputFocus?: (widgetId: string) => void;
2426
3478
  }
2427
3479
 
@@ -2733,6 +3785,49 @@ export declare const QuestionTextSchema: z.ZodObject<{
2733
3785
  id: string;
2734
3786
  }>;
2735
3787
 
3788
+ export declare type RadioOptionsBlock = z.infer<typeof RadioOptionsBlockSchema>;
3789
+
3790
+ /**
3791
+ * Radio options block schema - single-choice radio buttons
3792
+ *
3793
+ * @example
3794
+ * {
3795
+ * type: "RadioOptions",
3796
+ * name: "q1",
3797
+ * options: ["apple", "orange", "banana"],
3798
+ * answer: "apple"
3799
+ * }
3800
+ */
3801
+ declare const RadioOptionsBlockSchema: z.ZodObject<{
3802
+ type: z.ZodLiteral<"RadioOptions">;
3803
+ name: z.ZodString;
3804
+ options: z.ZodArray<z.ZodString, "many">;
3805
+ answer: z.ZodString;
3806
+ }, "strip", z.ZodTypeAny, {
3807
+ type: "RadioOptions";
3808
+ options: string[];
3809
+ name: string;
3810
+ answer: string;
3811
+ }, {
3812
+ type: "RadioOptions";
3813
+ options: string[];
3814
+ name: string;
3815
+ answer: string;
3816
+ }>;
3817
+
3818
+ export declare type RadioOptionsJSON = z.infer<typeof RadioOptionsJSONSchema>;
3819
+
3820
+ export declare const RadioOptionsJSONSchema: z.ZodObject<{
3821
+ type: z.ZodLiteral<"radio-options">;
3822
+ options: z.ZodArray<z.ZodString, "many">;
3823
+ }, "strip", z.ZodTypeAny, {
3824
+ type: "radio-options";
3825
+ options: string[];
3826
+ }, {
3827
+ type: "radio-options";
3828
+ options: string[];
3829
+ }>;
3830
+
2736
3831
  /**
2737
3832
  * DOM helper for quick usage / demos.
2738
3833
  *
@@ -3758,6 +4853,9 @@ export declare function toJSON(ast: ExerciseDocument): ExerciseJSON;
3758
4853
  /**
3759
4854
  * Tokenize a DSL input string
3760
4855
  *
4856
+ * Non-breaking spaces (U+00A0) copied from Slack/Teams are replaced with
4857
+ * regular spaces before tokenization to avoid silent parse failures.
4858
+ *
3761
4859
  * @param input - The DSL text to tokenize
3762
4860
  * @returns Array of tokens
3763
4861
  * @throws LexerError if tokenization fails
@@ -3775,6 +4873,8 @@ declare interface TokenizeResult {
3775
4873
  /**
3776
4874
  * Tokenize without throwing - returns both tokens and errors
3777
4875
  * Useful for error-tolerant parsing (e.g., in editors)
4876
+ *
4877
+ * Non-breaking spaces (U+00A0) are sanitized the same way as in tokenize().
3778
4878
  */
3779
4879
  export declare function tokenizeSafe(input: string): TokenizeResult;
3780
4880
 
@@ -3881,6 +4981,9 @@ export declare function validateExerciseJSON(data: unknown): {
3881
4981
  } | {
3882
4982
  type: "drag-options";
3883
4983
  options: string[];
4984
+ } | {
4985
+ type: "radio-options";
4986
+ options: string[];
3884
4987
  } | {
3885
4988
  type: "numeric-keypad";
3886
4989
  includeOperators?: boolean | undefined;
@@ -3931,6 +5034,9 @@ export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseRetu
3931
5034
  } | {
3932
5035
  type: "drag-options";
3933
5036
  options: string[];
5037
+ } | {
5038
+ type: "radio-options";
5039
+ options: string[];
3934
5040
  } | {
3935
5041
  type: "numeric-keypad";
3936
5042
  includeOperators?: boolean | undefined;
@@ -3963,6 +5069,9 @@ export declare function validateExerciseJSONSafe(data: unknown): z.SafeParseRetu
3963
5069
  } | {
3964
5070
  type: "drag-options";
3965
5071
  options: string[];
5072
+ } | {
5073
+ type: "radio-options";
5074
+ options: string[];
3966
5075
  } | {
3967
5076
  type: "numeric-keypad";
3968
5077
  includeOperators?: boolean | undefined;
@@ -4023,6 +5132,9 @@ export declare function validateWidgetJSON(data: unknown): {
4023
5132
  } | {
4024
5133
  type: "drag-options";
4025
5134
  options: string[];
5135
+ } | {
5136
+ type: "radio-options";
5137
+ options: string[];
4026
5138
  } | {
4027
5139
  type: "numeric-keypad";
4028
5140
  includeOperators?: boolean | undefined;
@@ -4046,6 +5158,9 @@ export declare function validateWidgetJSONSafe(data: unknown): z.SafeParseReturn
4046
5158
  } | {
4047
5159
  type: "drag-options";
4048
5160
  options: string[];
5161
+ } | {
5162
+ type: "radio-options";
5163
+ options: string[];
4049
5164
  } | {
4050
5165
  type: "numeric-keypad";
4051
5166
  includeOperators?: boolean | undefined;
@@ -4061,6 +5176,9 @@ export declare function validateWidgetJSONSafe(data: unknown): z.SafeParseReturn
4061
5176
  } | {
4062
5177
  type: "drag-options";
4063
5178
  options: string[];
5179
+ } | {
5180
+ type: "radio-options";
5181
+ options: string[];
4064
5182
  } | {
4065
5183
  type: "numeric-keypad";
4066
5184
  includeOperators?: boolean | undefined;
@@ -4169,6 +5287,15 @@ export declare const WidgetJSONSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"inpu
4169
5287
  }, {
4170
5288
  type: "drag-options";
4171
5289
  options: string[];
5290
+ }>, z.ZodObject<{
5291
+ type: z.ZodLiteral<"radio-options">;
5292
+ options: z.ZodArray<z.ZodString, "many">;
5293
+ }, "strip", z.ZodTypeAny, {
5294
+ type: "radio-options";
5295
+ options: string[];
5296
+ }, {
5297
+ type: "radio-options";
5298
+ options: string[];
4172
5299
  }>, z.ZodObject<{
4173
5300
  type: z.ZodLiteral<"numeric-keypad">;
4174
5301
  includeOperators: z.ZodOptional<z.ZodBoolean>;
@@ -4211,7 +5338,7 @@ export declare interface WidgetRendererProps {
4211
5338
  widgetId: string;
4212
5339
  value: string;
4213
5340
  isDropped?: boolean;
4214
- onChange: (widgetId: string, value: string, fromDrop?: boolean) => void;
5341
+ onChange: (widgetId: string, value: string, fromDrop?: boolean, sourceOptionId?: string) => void;
4215
5342
  onInputFocus?: (widgetId: string) => void;
4216
5343
  onKeypadChange?: (value: string) => void;
4217
5344
  }