@mathscan/math-exercise-engine 1.1.13 → 1.1.14
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 +49 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2059,12 +2059,14 @@ function createNumberLineBlock(min, max, positions, step, minorTicks, style, lab
|
|
|
2059
2059
|
const TableCellSchema = z.object({
|
|
2060
2060
|
type: z.literal(AST_TYPES.TABLE_CELL),
|
|
2061
2061
|
colspan: z.number().int().positive().optional(),
|
|
2062
|
+
rowspan: z.number().int().positive().optional(),
|
|
2062
2063
|
inlines: z.array(InlineNodeSchema)
|
|
2063
2064
|
});
|
|
2064
|
-
function createTableCell(inlines, colspan) {
|
|
2065
|
+
function createTableCell(inlines, colspan, rowspan) {
|
|
2065
2066
|
return TableCellSchema.parse({
|
|
2066
2067
|
type: AST_TYPES.TABLE_CELL,
|
|
2067
2068
|
colspan,
|
|
2069
|
+
rowspan,
|
|
2068
2070
|
inlines
|
|
2069
2071
|
});
|
|
2070
2072
|
}
|
|
@@ -2680,8 +2682,9 @@ class NaturalDSLVisitor extends BaseCstVisitor {
|
|
|
2680
2682
|
cell(ctx) {
|
|
2681
2683
|
const params = ctx.parameterList ? this.visit(ctx.parameterList) : {};
|
|
2682
2684
|
const colspan = params.colspan;
|
|
2685
|
+
const rowspan = params.rowspan;
|
|
2683
2686
|
const inlines = ctx.inlineElement ? ctx.inlineElement.map((elem) => this.visit(elem)) : [];
|
|
2684
|
-
return createTableCell(inlines, colspan);
|
|
2687
|
+
return createTableCell(inlines, colspan, rowspan);
|
|
2685
2688
|
}
|
|
2686
2689
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
2687
2690
|
// Number Line Block
|
|
@@ -3382,6 +3385,7 @@ const TableCellItemSchema = z.object({
|
|
|
3382
3385
|
id: z.string(),
|
|
3383
3386
|
type: z.literal(JSON_TYPES.TABLE_CELL),
|
|
3384
3387
|
colspan: z.number().int().positive().optional(),
|
|
3388
|
+
rowspan: z.number().int().positive().optional(),
|
|
3385
3389
|
items: z.array(LayoutItemSchema)
|
|
3386
3390
|
});
|
|
3387
3391
|
const TableRowItemSchema = z.object({
|
|
@@ -9668,6 +9672,9 @@ function transformTable(table, idGenerator, inlineDragIds) {
|
|
|
9668
9672
|
if (cell.colspan !== void 0) {
|
|
9669
9673
|
cellItem.colspan = cell.colspan;
|
|
9670
9674
|
}
|
|
9675
|
+
if (cell.rowspan !== void 0) {
|
|
9676
|
+
cellItem.rowspan = cell.rowspan;
|
|
9677
|
+
}
|
|
9671
9678
|
return cellItem;
|
|
9672
9679
|
});
|
|
9673
9680
|
return {
|
|
@@ -18279,6 +18286,7 @@ const LayoutRenderer = ({
|
|
|
18279
18286
|
{
|
|
18280
18287
|
className: "exercise-table-cell",
|
|
18281
18288
|
colSpan: cell.colspan || 1,
|
|
18289
|
+
rowSpan: cell.rowspan || 1,
|
|
18282
18290
|
children: cell.items.map((subItem) => /* @__PURE__ */ jsx(
|
|
18283
18291
|
LayoutRenderer,
|
|
18284
18292
|
{
|