@khanacademy/perseus-core 42.5.1 → 43.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-schema.d.ts +2 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +58 -53
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/blank-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/categorizer-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/cs-program-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/definition-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/dropdown-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/explanation-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/expression-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/fill-in-the-blank-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/graded-group-set-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/graded-group-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/grapher-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/group-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/iframe-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/image-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/input-number-widget.d.ts +2 -2
- package/dist/parse-perseus-json/perseus-parsers/interaction-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/interactive-graph-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/label-image-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/matcher-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/matrix-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/measurer-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/number-line-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/numeric-input-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/orderer-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/phet-simulation-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/plotter-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/python-program-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/radio-widget.d.ts +5 -5
- package/dist/parse-perseus-json/perseus-parsers/sorter-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/table-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/video-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/widget.d.ts +2 -2
- package/dist/utils/table-row-headers.d.ts +20 -0
- package/dist/widgets/core-widget-registry.d.ts +4 -4
- package/dist/widgets/logic-export.types.d.ts +6 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ export declare const parseBlankWidget: import("../parser-types").Parser<import("
|
|
|
2
2
|
type: "blank";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
displayType: "normal" | "superscript" | "subscript";
|
|
8
8
|
correctId: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseCategorizerWidget: import("../parser-types").Parser<im
|
|
|
2
2
|
type: "categorizer";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
items: string[];
|
|
8
8
|
categories: string[];
|
|
@@ -2,7 +2,7 @@ export declare const parseCSProgramWidget: import("../parser-types").Parser<impo
|
|
|
2
2
|
type: "cs-program";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
programID: string;
|
|
8
8
|
programType: any;
|
|
@@ -2,7 +2,7 @@ export declare const parseDefinitionWidget: import("../parser-types").Parser<imp
|
|
|
2
2
|
type: "definition";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
togglePrompt: string;
|
|
8
8
|
definition: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseDropdownWidget: import("../parser-types").Parser<impor
|
|
|
2
2
|
type: "dropdown";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
placeholder: string;
|
|
8
8
|
ariaLabel: string | undefined;
|
|
@@ -2,7 +2,7 @@ export declare const parseExplanationWidget: import("../parser-types").Parser<im
|
|
|
2
2
|
type: "explanation";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
showPrompt: string;
|
|
8
8
|
hidePrompt: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseExpressionWidget: import("../parser-types").Parser<imp
|
|
|
2
2
|
type: "expression";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
answerForms: {
|
|
8
8
|
value: string;
|
|
@@ -3,7 +3,7 @@ export declare const parseFillInTheBlankWidget: Parser<import("../general-purpos
|
|
|
3
3
|
type: "fill-in-the-blank";
|
|
4
4
|
static: boolean | undefined;
|
|
5
5
|
graded: boolean | undefined;
|
|
6
|
-
alignment: "
|
|
6
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
7
7
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
content: string;
|
|
9
9
|
widgets: import("../..").MakeWidgetMap<import("../..").PerseusWidgetTypes>;
|
|
@@ -2,7 +2,7 @@ export declare const parseGradedGroupSetWidget: import("../parser-types").Parser
|
|
|
2
2
|
type: "graded-group-set";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
gradedGroups: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
title: string;
|
|
@@ -21,7 +21,7 @@ export declare const parseGradedGroupWidget: import("../parser-types").Parser<im
|
|
|
21
21
|
type: "graded-group";
|
|
22
22
|
static: boolean | undefined;
|
|
23
23
|
graded: boolean | undefined;
|
|
24
|
-
alignment: "
|
|
24
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
25
25
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
26
26
|
title: string;
|
|
27
27
|
hint: import("../..").PerseusRenderer | null | undefined;
|
|
@@ -3,7 +3,7 @@ export declare const parseGrapherWidget: Parser<import("../general-purpose-parse
|
|
|
3
3
|
type: "grapher";
|
|
4
4
|
static: boolean | undefined;
|
|
5
5
|
graded: boolean | undefined;
|
|
6
|
-
alignment: "
|
|
6
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
7
7
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
availableTypes: ("absolute_value" | "exponential" | "linear" | "logarithm" | "quadratic" | "sinusoid" | "tangent")[];
|
|
9
9
|
correct: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -2,7 +2,7 @@ export declare const parseGroupWidget: import("../parser-types").Parser<import("
|
|
|
2
2
|
type: "group";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../..").PerseusRenderer;
|
|
7
7
|
key: number | null | undefined;
|
|
8
8
|
version: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -2,7 +2,7 @@ export declare const parseIframeWidget: import("../parser-types").Parser<import(
|
|
|
2
2
|
type: "iframe";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
url: string;
|
|
8
8
|
settings: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -2,7 +2,7 @@ export declare const parseImageWidget: import("../parser-types").Parser<import("
|
|
|
2
2
|
type: "image";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
title: string;
|
|
8
8
|
caption: string;
|
|
@@ -4,7 +4,7 @@ declare const parseInputNumberWidgetV0: Parser<import("../general-purpose-parser
|
|
|
4
4
|
type: "input-number";
|
|
5
5
|
static: boolean | undefined;
|
|
6
6
|
graded: boolean | undefined;
|
|
7
|
-
alignment: "
|
|
7
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
8
8
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
9
9
|
answerType: "number" | "integer" | "mixed" | "improper" | "decimal" | "percent" | "pi" | "rational" | undefined;
|
|
10
10
|
inexact: boolean | undefined;
|
|
@@ -24,7 +24,7 @@ export declare const parseInputNumberWidget: Parser<import("../general-purpose-p
|
|
|
24
24
|
type: "input-number";
|
|
25
25
|
static: boolean | undefined;
|
|
26
26
|
graded: boolean | undefined;
|
|
27
|
-
alignment: "
|
|
27
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
28
28
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
29
29
|
size: string;
|
|
30
30
|
coefficient: boolean;
|
|
@@ -2,7 +2,7 @@ export declare const parseInteractionWidget: import("../parser-types").Parser<im
|
|
|
2
2
|
type: "interaction";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
graph: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
editableSettings: ("graph" | "canvas")[] | undefined;
|
|
@@ -246,7 +246,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
|
|
|
246
246
|
type: "interactive-graph";
|
|
247
247
|
static: boolean | undefined;
|
|
248
248
|
graded: boolean | undefined;
|
|
249
|
-
alignment: "
|
|
249
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
250
250
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
251
251
|
step: [number, number];
|
|
252
252
|
gridStep: [number, number] | undefined;
|
|
@@ -2,7 +2,7 @@ export declare const parseLabelImageWidget: import("../parser-types").Parser<imp
|
|
|
2
2
|
type: "label-image";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
choices: string[];
|
|
8
8
|
imageUrl: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseMatcherWidget: import("../parser-types").Parser<import
|
|
|
2
2
|
type: "matcher";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
labels: string[];
|
|
8
8
|
left: string[];
|
|
@@ -2,7 +2,7 @@ export declare const parseMatrixWidget: import("../parser-types").Parser<import(
|
|
|
2
2
|
type: "matrix";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
prefix: string;
|
|
8
8
|
suffix: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseMeasurerWidget: import("../parser-types").Parser<impor
|
|
|
2
2
|
type: "measurer";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
image: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
url: string | null | undefined;
|
|
@@ -2,7 +2,7 @@ export declare const parseNumberLineWidget: import("../parser-types").Parser<imp
|
|
|
2
2
|
type: "number-line";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
range: [number, number];
|
|
8
8
|
labelRange: [number | null, number | null];
|
|
@@ -3,7 +3,7 @@ export declare const parseNumericInputWidget: import("../parser-types").Parser<i
|
|
|
3
3
|
type: "numeric-input";
|
|
4
4
|
static: boolean | undefined;
|
|
5
5
|
graded: boolean | undefined;
|
|
6
|
-
alignment: "
|
|
6
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
7
7
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
answers: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
9
9
|
message: string;
|
|
@@ -2,7 +2,7 @@ export declare const parseOrdererWidget: import("../parser-types").Parser<import
|
|
|
2
2
|
type: "orderer";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
options: import("../..").PerseusRenderer[];
|
|
8
8
|
correctOptions: import("../..").PerseusRenderer[];
|
|
@@ -2,7 +2,7 @@ export declare const parsePhetSimulationWidget: import("../parser-types").Parser
|
|
|
2
2
|
type: "phet-simulation";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
url: string;
|
|
8
8
|
description: string;
|
|
@@ -2,7 +2,7 @@ export declare const parsePlotterWidget: import("../parser-types").Parser<import
|
|
|
2
2
|
type: "plotter";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
labels: string[];
|
|
8
8
|
categories: string[];
|
|
@@ -2,7 +2,7 @@ export declare const parsePythonProgramWidget: import("../parser-types").Parser<
|
|
|
2
2
|
type: "python-program";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
programID: string;
|
|
8
8
|
height: number;
|
|
@@ -3,7 +3,7 @@ declare const parseRadioWidgetV3: import("../parser-types").Parser<import("../ge
|
|
|
3
3
|
type: "radio";
|
|
4
4
|
static: boolean | undefined;
|
|
5
5
|
graded: boolean | undefined;
|
|
6
|
-
alignment: "
|
|
6
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
7
7
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
8
8
|
numCorrect: number | undefined;
|
|
9
9
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -29,7 +29,7 @@ declare const parseRadioWidgetV2: import("../parser-types").Parser<import("../ge
|
|
|
29
29
|
type: "radio";
|
|
30
30
|
static: boolean | undefined;
|
|
31
31
|
graded: boolean | undefined;
|
|
32
|
-
alignment: "
|
|
32
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
33
33
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
34
34
|
numCorrect: number | undefined;
|
|
35
35
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -59,7 +59,7 @@ declare const parseRadioWidgetV1: import("../parser-types").Parser<import("../ge
|
|
|
59
59
|
type: "radio";
|
|
60
60
|
static: boolean | undefined;
|
|
61
61
|
graded: boolean | undefined;
|
|
62
|
-
alignment: "
|
|
62
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
63
63
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
64
64
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
65
65
|
content: string;
|
|
@@ -87,7 +87,7 @@ declare const parseRadioWidgetV0: import("../parser-types").Parser<import("../ge
|
|
|
87
87
|
type: "radio";
|
|
88
88
|
static: boolean | undefined;
|
|
89
89
|
graded: boolean | undefined;
|
|
90
|
-
alignment: "
|
|
90
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
91
91
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
92
92
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
93
93
|
content: string;
|
|
@@ -118,7 +118,7 @@ export declare const parseRadioWidget: import("../parser-types").Parser<import("
|
|
|
118
118
|
type: "radio";
|
|
119
119
|
static: boolean | undefined;
|
|
120
120
|
graded: boolean | undefined;
|
|
121
|
-
alignment: "
|
|
121
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
122
122
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
123
123
|
numCorrect: number | undefined;
|
|
124
124
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -2,7 +2,7 @@ export declare const parseSorterWidget: import("../parser-types").Parser<import(
|
|
|
2
2
|
type: "sorter";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
correct: string[];
|
|
8
8
|
padding: boolean;
|
|
@@ -2,7 +2,7 @@ export declare const parseTableWidget: import("../parser-types").Parser<import("
|
|
|
2
2
|
type: "table";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
headers: string[];
|
|
8
8
|
rows: number;
|
|
@@ -2,7 +2,7 @@ export declare const parseVideoWidget: import("../parser-types").Parser<import("
|
|
|
2
2
|
type: "video";
|
|
3
3
|
static: boolean | undefined;
|
|
4
4
|
graded: boolean | undefined;
|
|
5
|
-
alignment: "
|
|
5
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
7
|
location: string;
|
|
8
8
|
}>;
|
|
@@ -11,7 +11,7 @@ export declare function parseWidget<Type extends string, Options extends object>
|
|
|
11
11
|
type: Type;
|
|
12
12
|
static: boolean | undefined;
|
|
13
13
|
graded: boolean | undefined;
|
|
14
|
-
alignment: "
|
|
14
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
15
15
|
options: Options;
|
|
16
16
|
key: number | null | undefined;
|
|
17
17
|
version: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -26,7 +26,7 @@ export declare function parseWidgetWithVersion<Type extends string, Options exte
|
|
|
26
26
|
type: Type;
|
|
27
27
|
static: boolean | undefined;
|
|
28
28
|
graded: boolean | undefined;
|
|
29
|
-
alignment: "
|
|
29
|
+
alignment: "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
30
30
|
options: Options;
|
|
31
31
|
key: number | null | undefined;
|
|
32
32
|
version: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type MarkdownNode = {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
type TableCell = ReadonlyArray<MarkdownNode>;
|
|
6
|
+
export declare function isEmptyTableCell(cell: TableCell): boolean;
|
|
7
|
+
export declare function isBoldTableCell(cell: TableCell): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Markdown has no syntax for row headers, so we infer them from two common
|
|
10
|
+
* authoring patterns:
|
|
11
|
+
*
|
|
12
|
+
* 1. The first column header is empty.
|
|
13
|
+
* Or
|
|
14
|
+
* 2. Every body cell in the first column is bold.
|
|
15
|
+
*
|
|
16
|
+
* Tables with a single column are never treated as having row headers, as
|
|
17
|
+
* there would be no data cells for the headers to describe.
|
|
18
|
+
*/
|
|
19
|
+
export declare function tableHasRowHeaders(node: MarkdownNode): boolean;
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PublicWidgetOptionsFunction, WidgetLogic } from "./logic-export.types";
|
|
2
|
-
import type {
|
|
1
|
+
import type { PublicWidgetOptionsFunction, SupportedAlignments, WidgetLogic } from "./logic-export.types";
|
|
2
|
+
import type { Alignment, PerseusWidget, PerseusWidgetOptions } from "../data-schema";
|
|
3
3
|
export declare function registerWidget(type: string, logic: WidgetLogic<any, any>): void;
|
|
4
4
|
export declare function isWidgetRegistered(type: string): boolean;
|
|
5
5
|
export declare function getCurrentVersion(type: string): import("..").Version;
|
|
@@ -19,7 +19,7 @@ export declare const traverseChildWidgets: (widgetInfo: PerseusWidget, traverseR
|
|
|
19
19
|
* Supported alignments are given as an array of strings in the exports of
|
|
20
20
|
* a widget's module.
|
|
21
21
|
*/
|
|
22
|
-
export declare const getSupportedAlignments: (type: string) =>
|
|
22
|
+
export declare const getSupportedAlignments: (type: string) => SupportedAlignments;
|
|
23
23
|
/**
|
|
24
24
|
* For the given (string) widget type, determine the default alignment for
|
|
25
25
|
* the widget. This is used at rendering time to go from "default" alignment
|
|
@@ -39,7 +39,7 @@ export declare const isInlineWidget: (type: string, alignment?: Alignment) => bo
|
|
|
39
39
|
* Returns the CSS class name corresponding to the specified widget alignment.
|
|
40
40
|
* Uses explicit mapping to make it easy to locate related CSS style definitions.
|
|
41
41
|
*/
|
|
42
|
-
export declare
|
|
42
|
+
export declare function getAlignmentClassName(alignment: Alignment): string;
|
|
43
43
|
/**
|
|
44
44
|
* We use a function here rather than registering widgets
|
|
45
45
|
* at the top-level of the file to avoid circular dependencies.
|
|
@@ -30,6 +30,7 @@ export type WidgetOptionsUpgradeMap = {
|
|
|
30
30
|
* so reliant on a set group of widgets
|
|
31
31
|
*/
|
|
32
32
|
export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getFillInTheBlankPublicWidgetOptions | typeof getFreeResponsePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getGroupPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getInputNumberPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getMatcherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getPlotterPublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getTablePublicWidgetOptions;
|
|
33
|
+
export type SupportedAlignments = [defaultAlignment: Alignment, ...Alignment[]];
|
|
33
34
|
export type WidgetLogic<TWidgetOptions, TPublicWidgetOptions = never> = {
|
|
34
35
|
name: string;
|
|
35
36
|
/**
|
|
@@ -43,8 +44,11 @@ export type WidgetLogic<TWidgetOptions, TPublicWidgetOptions = never> = {
|
|
|
43
44
|
*/
|
|
44
45
|
version?: Version;
|
|
45
46
|
defaultWidgetOptions: TWidgetOptions;
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The set of alignments this widget supports. The first alignment listed
|
|
49
|
+
* is the default.
|
|
50
|
+
*/
|
|
51
|
+
supportedAlignments?: SupportedAlignments;
|
|
48
52
|
accessible?: boolean | ((options: TWidgetOptions) => boolean);
|
|
49
53
|
traverseChildWidgets?: (props: any, traverseRenderer: any) => any;
|
|
50
54
|
/**
|