@khanacademy/perseus-editor 2.6.0 → 2.6.2
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/CHANGELOG.md +24 -0
- package/dist/article-editor.d.ts +1 -2
- package/dist/components/form-wrapped-text-field.d.ts +1 -10
- package/dist/components/graph-points-count-selector.d.ts +1 -1
- package/dist/es/index.js +414 -436
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +411 -435
- package/dist/index.js.map +1 -1
- package/dist/widgets/input-number-editor.d.ts +1 -2
- package/dist/widgets/interactive-graph-editor.d.ts +48 -47
- package/dist/widgets/plotter-editor.d.ts +47 -23
- package/package.json +12 -12
- package/src/__stories__/editor.stories.tsx +3 -1
- package/src/__tests__/i18n.test.ts +1 -1
- package/src/article-editor.tsx +13 -14
- package/src/components/checkbox.tsx +2 -1
- package/src/components/dropdown-option.tsx +13 -12
- package/src/components/form-wrapped-text-field.tsx +5 -2
- package/src/components/graph-points-count-selector.tsx +3 -1
- package/src/components/graph-settings.tsx +1 -1
- package/src/components/hover-behavior.ts +2 -2
- package/src/components/json-editor.tsx +2 -2
- package/src/components/sortable.tsx +1 -1
- package/src/components/util.ts +1 -1
- package/src/components/widget-editor.tsx +8 -7
- package/src/diffs/__tests__/structured-item-diff.test.ts +8 -8
- package/src/diffs/renderer-diff.tsx +3 -3
- package/src/diffs/split-diff.ts +2 -2
- package/src/diffs/structured-item-diff.tsx +11 -10
- package/src/diffs/text-diff.tsx +1 -1
- package/src/diffs/widget-diff.tsx +2 -2
- package/src/editor-page.tsx +8 -8
- package/src/editor.tsx +37 -36
- package/src/hint-editor.tsx +28 -27
- package/src/i18n.ts +4 -4
- package/src/iframe-content-renderer.tsx +10 -10
- package/src/item-editor.tsx +4 -4
- package/src/katex-mhchem/parser.js +24 -24
- package/src/multirenderer-editor.tsx +11 -11
- package/src/widgets/__stories__/label-image-editor.stories.tsx +1 -0
- package/src/widgets/__stories__/radio-editor.stories.tsx +1 -0
- package/src/widgets/categorizer-editor.tsx +3 -3
- package/src/widgets/cs-program-editor.tsx +2 -2
- package/src/widgets/definition-editor.tsx +3 -2
- package/src/widgets/dropdown-editor.tsx +9 -8
- package/src/widgets/example-graphie-widget-editor.tsx +1 -1
- package/src/widgets/example-graphie-widget.tsx +2 -2
- package/src/widgets/example-widget-editor.tsx +2 -2
- package/src/widgets/example-widget.tsx +4 -3
- package/src/widgets/explanation-editor.tsx +4 -3
- package/src/widgets/expression-editor.tsx +9 -9
- package/src/widgets/graded-group-editor.tsx +7 -6
- package/src/widgets/graded-group-set-editor.tsx +3 -3
- package/src/widgets/grapher-editor.tsx +3 -2
- package/src/widgets/group-editor.tsx +4 -3
- package/src/widgets/iframe-editor.tsx +5 -4
- package/src/widgets/input-number-editor.tsx +6 -6
- package/src/widgets/interaction-editor.tsx +103 -102
- package/src/widgets/interactive-graph-editor.tsx +12 -8
- package/src/widgets/label-image/marker.tsx +2 -1
- package/src/widgets/label-image/question-markers.tsx +1 -1
- package/src/widgets/lights-puzzle-editor.tsx +5 -4
- package/src/widgets/matrix-editor.tsx +2 -2
- package/src/widgets/measurer-editor.tsx +7 -6
- package/src/widgets/molecule-editor.tsx +2 -2
- package/src/widgets/number-line-editor.tsx +2 -1
- package/src/widgets/numeric-input-editor.tsx +2 -2
- package/src/widgets/orderer-editor.tsx +3 -2
- package/src/widgets/passage-editor.tsx +3 -3
- package/src/widgets/passage-ref-editor.tsx +4 -3
- package/src/widgets/passage-ref-target-editor.tsx +1 -1
- package/src/widgets/plotter-editor.tsx +253 -243
- package/src/widgets/radio/editor.tsx +3 -3
- package/src/widgets/reaction-diagram-editor.tsx +5 -5
- package/src/widgets/sequence-editor.tsx +1 -1
- package/src/widgets/simple-markdown-tester-editor.tsx +4 -3
- package/src/widgets/simple-markdown-tester.tsx +2 -2
- package/src/widgets/simulator-editor.tsx +1 -1
- package/src/widgets/sorter-editor.tsx +2 -1
- package/src/widgets/table-editor.tsx +1 -1
- package/src/widgets/transformer-editor.tsx +10 -10
- package/src/widgets/unit-editor.tsx +5 -5
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/all-editors.js.flow +0 -8
- package/dist/all-widgets.js.flow +0 -34
- package/dist/article-editor.js.flow +0 -72
- package/dist/components/blur-input.js.flow +0 -25
- package/dist/components/checkbox.js.flow +0 -26
- package/dist/components/device-framer.js.flow +0 -20
- package/dist/components/drag-target.js.flow +0 -8
- package/dist/components/dropdown-option.js.flow +0 -49
- package/dist/components/form-wrapped-text-field.js.flow +0 -45
- package/dist/components/graph-points-count-selector.js.flow +0 -12
- package/dist/components/graph-settings.js.flow +0 -8
- package/dist/components/graph-type-selector.js.flow +0 -12
- package/dist/components/hover-behavior.js.flow +0 -48
- package/dist/components/json-editor.js.flow +0 -8
- package/dist/components/link.js.flow +0 -50
- package/dist/components/section-control-button.js.flow +0 -25
- package/dist/components/segment-count-selector.js.flow +0 -11
- package/dist/components/simple-button.js.flow +0 -18
- package/dist/components/sortable.js.flow +0 -8
- package/dist/components/util.js.flow +0 -9
- package/dist/components/viewport-resizer.js.flow +0 -22
- package/dist/components/widget-editor.js.flow +0 -91
- package/dist/components/widget-select.js.flow +0 -16
- package/dist/diffs/article-diff.js.flow +0 -71
- package/dist/diffs/item-diff.js.flow +0 -41
- package/dist/diffs/renderer-diff.js.flow +0 -25
- package/dist/diffs/split-diff.js.flow +0 -8
- package/dist/diffs/string-array-diff.js.flow +0 -11
- package/dist/diffs/structured-item-diff.js.flow +0 -37
- package/dist/diffs/tags-diff.js.flow +0 -24
- package/dist/diffs/text-diff.js.flow +0 -21
- package/dist/diffs/widget-diff-performer.js.flow +0 -8
- package/dist/diffs/widget-diff.js.flow +0 -31
- package/dist/editor-page.js.flow +0 -72
- package/dist/editor.js.flow +0 -96
- package/dist/hint-editor.js.flow +0 -87
- package/dist/i18n.js.flow +0 -13
- package/dist/iframe-content-renderer.js.flow +0 -28
- package/dist/index.js.flow +0 -23
- package/dist/item-editor.js.flow +0 -46
- package/dist/item-extras-editor.js.flow +0 -23
- package/dist/katex-error-view.js.flow +0 -24
- package/dist/multirenderer-editor.js.flow +0 -46
- package/dist/stateful-article-editor.js.flow +0 -16
- package/dist/stateful-editor-page.js.flow +0 -8
- package/dist/testing-widgets.js.flow +0 -34
- package/dist/util/points.js.flow +0 -9
- package/dist/util/register-all-widgets-and-editors-for-testing.js.flow +0 -7
- package/dist/widgets/categorizer-editor.js.flow +0 -62
- package/dist/widgets/cs-program-editor.js.flow +0 -25
- package/dist/widgets/definition-editor.js.flow +0 -23
- package/dist/widgets/dropdown-editor.js.flow +0 -37
- package/dist/widgets/example-graphie-widget-editor.js.flow +0 -25
- package/dist/widgets/example-graphie-widget.js.flow +0 -102
- package/dist/widgets/example-widget-editor.js.flow +0 -26
- package/dist/widgets/example-widget.js.flow +0 -86
- package/dist/widgets/explanation-editor.js.flow +0 -27
- package/dist/widgets/expression-editor.js.flow +0 -43
- package/dist/widgets/graded-group-editor.js.flow +0 -68
- package/dist/widgets/graded-group-set-editor.js.flow +0 -66
- package/dist/widgets/grapher-editor.js.flow +0 -21
- package/dist/widgets/group-editor.js.flow +0 -64
- package/dist/widgets/iframe-editor.js.flow +0 -24
- package/dist/widgets/image-editor.js.flow +0 -8
- package/dist/widgets/input-number-editor.js.flow +0 -77
- package/dist/widgets/interaction/constraint-editor.js.flow +0 -35
- package/dist/widgets/interaction-editor.js.flow +0 -36
- package/dist/widgets/interactive-graph-editor.js.flow +0 -5803
- package/dist/widgets/label-image/answer-choices.js.flow +0 -16
- package/dist/widgets/label-image/behavior.js.flow +0 -17
- package/dist/widgets/label-image/marker.js.flow +0 -32
- package/dist/widgets/label-image/question-markers.js.flow +0 -23
- package/dist/widgets/label-image/select-image.js.flow +0 -13
- package/dist/widgets/label-image-editor.js.flow +0 -44
- package/dist/widgets/lights-puzzle-editor.js.flow +0 -34
- package/dist/widgets/matcher-editor.js.flow +0 -28
- package/dist/widgets/matrix-editor.js.flow +0 -26
- package/dist/widgets/measurer-editor.js.flow +0 -42
- package/dist/widgets/molecule-editor.js.flow +0 -23
- package/dist/widgets/number-line-editor.js.flow +0 -45
- package/dist/widgets/numeric-input-editor.js.flow +0 -8
- package/dist/widgets/orderer-editor.js.flow +0 -30
- package/dist/widgets/passage-editor.js.flow +0 -24
- package/dist/widgets/passage-ref-editor.js.flow +0 -17
- package/dist/widgets/passage-ref-target-editor.js.flow +0 -22
- package/dist/widgets/plotter-editor.js.flow +0 -53
- package/dist/widgets/radio/editor.js.flow +0 -81
- package/dist/widgets/reaction-diagram-editor.js.flow +0 -26
- package/dist/widgets/sequence-editor.js.flow +0 -73
- package/dist/widgets/simple-markdown-tester-editor.js.flow +0 -23
- package/dist/widgets/simple-markdown-tester.js.flow +0 -61
- package/dist/widgets/simulator-editor.js.flow +0 -26
- package/dist/widgets/sorter-editor.js.flow +0 -22
- package/dist/widgets/table-editor.js.flow +0 -24
- package/dist/widgets/transformer-editor.js.flow +0 -17
- package/dist/widgets/unit-editor.js.flow +0 -41
- package/dist/widgets/video-editor.js.flow +0 -25
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
declare type Props = any;
|
|
10
|
-
declare type State = any;
|
|
11
|
-
declare class ArticleDiff extends React.Component<Props, State> {
|
|
12
|
-
static propTypes: {|
|
|
13
|
-
after: PropTypes.Validator<
|
|
14
|
-
$NonMaybeType<
|
|
15
|
-
$NonMaybeType<
|
|
16
|
-
| PropTypes.InferProps<{|
|
|
17
|
-
content: PropTypes.Requireable<string>,
|
|
18
|
-
images: PropTypes.Requireable<{
|
|
19
|
-
[x: string]: any,
|
|
20
|
-
}>,
|
|
21
|
-
widgets: PropTypes.Requireable<{
|
|
22
|
-
[x: string]: any,
|
|
23
|
-
}>,
|
|
24
|
-
|}>
|
|
25
|
-
| (PropTypes.InferProps<{|
|
|
26
|
-
content: PropTypes.Requireable<string>,
|
|
27
|
-
images: PropTypes.Requireable<{
|
|
28
|
-
[x: string]: any,
|
|
29
|
-
}>,
|
|
30
|
-
widgets: PropTypes.Requireable<{
|
|
31
|
-
[x: string]: any,
|
|
32
|
-
}>,
|
|
33
|
-
|}> | null | void)[]
|
|
34
|
-
| null
|
|
35
|
-
| void
|
|
36
|
-
>
|
|
37
|
-
>
|
|
38
|
-
>,
|
|
39
|
-
before: PropTypes.Validator<
|
|
40
|
-
$NonMaybeType<
|
|
41
|
-
$NonMaybeType<
|
|
42
|
-
| PropTypes.InferProps<{|
|
|
43
|
-
content: PropTypes.Requireable<string>,
|
|
44
|
-
images: PropTypes.Requireable<{
|
|
45
|
-
[x: string]: any,
|
|
46
|
-
}>,
|
|
47
|
-
widgets: PropTypes.Requireable<{
|
|
48
|
-
[x: string]: any,
|
|
49
|
-
}>,
|
|
50
|
-
|}>
|
|
51
|
-
| (PropTypes.InferProps<{|
|
|
52
|
-
content: PropTypes.Requireable<string>,
|
|
53
|
-
images: PropTypes.Requireable<{
|
|
54
|
-
[x: string]: any,
|
|
55
|
-
}>,
|
|
56
|
-
widgets: PropTypes.Requireable<{
|
|
57
|
-
[x: string]: any,
|
|
58
|
-
}>,
|
|
59
|
-
|}> | null | void)[]
|
|
60
|
-
| null
|
|
61
|
-
| void
|
|
62
|
-
>
|
|
63
|
-
>
|
|
64
|
-
>,
|
|
65
|
-
|};
|
|
66
|
-
static _stateFromProps: (arg1: Props) => State;
|
|
67
|
-
state: State;
|
|
68
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
69
|
-
render(): React.Node;
|
|
70
|
-
}
|
|
71
|
-
declare export default typeof ArticleDiff;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
declare type Props = any;
|
|
10
|
-
declare class ItemDiff extends React.Component<Props> {
|
|
11
|
-
static propTypes: {|
|
|
12
|
-
after: PropTypes.Validator<
|
|
13
|
-
$NonMaybeType<
|
|
14
|
-
PropTypes.InferProps<{|
|
|
15
|
-
question: PropTypes.Validator<
|
|
16
|
-
$NonMaybeType<PropTypes.InferProps<{||}>>
|
|
17
|
-
>,
|
|
18
|
-
answerArea: PropTypes.Validator<
|
|
19
|
-
$NonMaybeType<PropTypes.InferProps<{||}>>
|
|
20
|
-
>,
|
|
21
|
-
hints: PropTypes.Validator<any[]>,
|
|
22
|
-
|}>
|
|
23
|
-
>
|
|
24
|
-
>,
|
|
25
|
-
before: PropTypes.Validator<
|
|
26
|
-
$NonMaybeType<
|
|
27
|
-
PropTypes.InferProps<{|
|
|
28
|
-
question: PropTypes.Validator<
|
|
29
|
-
$NonMaybeType<PropTypes.InferProps<{||}>>
|
|
30
|
-
>,
|
|
31
|
-
answerArea: PropTypes.Validator<
|
|
32
|
-
$NonMaybeType<PropTypes.InferProps<{||}>>
|
|
33
|
-
>,
|
|
34
|
-
hints: PropTypes.Validator<any[]>,
|
|
35
|
-
|}>
|
|
36
|
-
>
|
|
37
|
-
>,
|
|
38
|
-
|};
|
|
39
|
-
render(): React.Node;
|
|
40
|
-
}
|
|
41
|
-
declare export default typeof ItemDiff;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import type { PerseusRenderer } from "@khanacademy/perseus";
|
|
9
|
-
declare type RendererProps = {|
|
|
10
|
-
content: string,
|
|
11
|
-
widgets: $PropertyType<PerseusRenderer, "widgets"> | null | void,
|
|
12
|
-
images: $PropertyType<PerseusRenderer, "images"> | null | void,
|
|
13
|
-
|};
|
|
14
|
-
declare type Props = {|
|
|
15
|
-
after: RendererProps,
|
|
16
|
-
before: RendererProps,
|
|
17
|
-
showAlignmentOptions: boolean,
|
|
18
|
-
showSeparator: boolean,
|
|
19
|
-
title: string,
|
|
20
|
-
|};
|
|
21
|
-
declare class RendererDiff extends React.Component<Props> {
|
|
22
|
-
static defaultProps: $Rest<$Diff<Props, { title: any }>, {}>;
|
|
23
|
-
render(): React.Node;
|
|
24
|
-
}
|
|
25
|
-
declare export default typeof RendererDiff;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
declare var stringArrayDiff: (
|
|
8
|
-
a: $ReadOnlyArray<any>,
|
|
9
|
-
b: $ReadOnlyArray<any>
|
|
10
|
-
) => any;
|
|
11
|
-
declare export default typeof stringArrayDiff;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import type { Item, Path, Shape } from "@khanacademy/perseus";
|
|
9
|
-
declare type ItemList = [mixed, Path];
|
|
10
|
-
declare type Tag = {|
|
|
11
|
-
idToName: (arg1: string) => string,
|
|
12
|
-
nameToId: (arg1: string) => string,
|
|
13
|
-
names: $ReadOnlyArray<string>,
|
|
14
|
-
|};
|
|
15
|
-
declare type Props = {|
|
|
16
|
-
after: Item,
|
|
17
|
-
before: Item,
|
|
18
|
-
shape: Shape,
|
|
19
|
-
tags: Tag,
|
|
20
|
-
|};
|
|
21
|
-
declare class StructuredItemDiff extends React.Component<Props> {
|
|
22
|
-
/**
|
|
23
|
-
* Traverses the given shape and adds paths that are present in
|
|
24
|
-
* beforeList and afterList to result. Note that this method assumes
|
|
25
|
-
* the order of elements in beforeList and afterList, which are
|
|
26
|
-
* from buildMapper(), is the same order they appear in in the shape.
|
|
27
|
-
*/
|
|
28
|
-
static generateCompletePathsList(
|
|
29
|
-
beforeList: Array<ItemList>,
|
|
30
|
-
afterList: Array<ItemList>,
|
|
31
|
-
result: Array<Path>,
|
|
32
|
-
shape: Shape,
|
|
33
|
-
path: $ReadOnlyArray<any>
|
|
34
|
-
): void;
|
|
35
|
-
render(): React.Node;
|
|
36
|
-
}
|
|
37
|
-
declare export default typeof StructuredItemDiff;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
declare type Props = {|
|
|
9
|
-
afterOnly: $ReadOnlyArray<string>,
|
|
10
|
-
beforeOnly: $ReadOnlyArray<string>,
|
|
11
|
-
intersection: $ReadOnlyArray<string>,
|
|
12
|
-
showSeparator: boolean,
|
|
13
|
-
title: string,
|
|
14
|
-
|};
|
|
15
|
-
declare class TagsDiff extends React.Component<Props> {
|
|
16
|
-
static defaultProps: {|
|
|
17
|
-
afterOnly: $ReadOnlyArray<any>,
|
|
18
|
-
beforeOnly: $ReadOnlyArray<any>,
|
|
19
|
-
showSeparator: boolean,
|
|
20
|
-
title: string,
|
|
21
|
-
|};
|
|
22
|
-
render(): React.Node;
|
|
23
|
-
}
|
|
24
|
-
declare export default typeof TagsDiff;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
declare class TextDiff extends React.Component<any, any> {
|
|
10
|
-
static propTypes: {|
|
|
11
|
-
after: PropTypes.Requireable<string>,
|
|
12
|
-
before: PropTypes.Requireable<string>,
|
|
13
|
-
title: PropTypes.Validator<string>,
|
|
14
|
-
|};
|
|
15
|
-
static defaultProps: any;
|
|
16
|
-
state: any;
|
|
17
|
-
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
18
|
-
handleExpand: () => void;
|
|
19
|
-
render(): React.Node;
|
|
20
|
-
}
|
|
21
|
-
declare export default typeof TextDiff;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
declare class WidgetDiff extends React.Component<any> {
|
|
10
|
-
static propTypes: {|
|
|
11
|
-
after: PropTypes.Requireable<
|
|
12
|
-
PropTypes.InferProps<{|
|
|
13
|
-
options: PropTypes.Requireable<{
|
|
14
|
-
[x: string]: any,
|
|
15
|
-
}>,
|
|
16
|
-
|}>
|
|
17
|
-
>,
|
|
18
|
-
before: PropTypes.Requireable<
|
|
19
|
-
PropTypes.InferProps<{|
|
|
20
|
-
options: PropTypes.Requireable<{
|
|
21
|
-
[x: string]: any,
|
|
22
|
-
}>,
|
|
23
|
-
|}>
|
|
24
|
-
>,
|
|
25
|
-
title: PropTypes.Validator<string>,
|
|
26
|
-
type: PropTypes.Requireable<string>,
|
|
27
|
-
|};
|
|
28
|
-
static defaultProps: any;
|
|
29
|
-
render(): React.Node;
|
|
30
|
-
}
|
|
31
|
-
declare export default typeof WidgetDiff;
|
package/dist/editor-page.js.flow
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import type {
|
|
9
|
-
APIOptions,
|
|
10
|
-
APIOptionsWithDefaults,
|
|
11
|
-
ChangeHandler,
|
|
12
|
-
DeviceType,
|
|
13
|
-
Hint,
|
|
14
|
-
ImageUploader,
|
|
15
|
-
Version,
|
|
16
|
-
} from "@khanacademy/perseus";
|
|
17
|
-
import type { RendererInterface, KEScore } from "@khanacademy/perseus-core";
|
|
18
|
-
declare type Props = {|
|
|
19
|
-
apiOptions?: APIOptions,
|
|
20
|
-
answerArea?: any,
|
|
21
|
-
contentPaths?: $ReadOnlyArray<string>,
|
|
22
|
-
developerMode: boolean,
|
|
23
|
-
frameSource: string,
|
|
24
|
-
hints?: $ReadOnlyArray<Hint>,
|
|
25
|
-
imageUploader?: ImageUploader,
|
|
26
|
-
itemDataVersion?: Version,
|
|
27
|
-
itemId: string,
|
|
28
|
-
jsonMode: boolean,
|
|
29
|
-
onChange: ChangeHandler,
|
|
30
|
-
onPreviewDeviceChange: (arg1: DeviceType) => mixed,
|
|
31
|
-
previewDevice: DeviceType,
|
|
32
|
-
question?: any,
|
|
33
|
-
previewURL: string,
|
|
34
|
-
|};
|
|
35
|
-
declare type PerseusJson = {|
|
|
36
|
-
question: any,
|
|
37
|
-
answerArea: any,
|
|
38
|
-
hints: $ReadOnlyArray<Hint>,
|
|
39
|
-
itemDataVersion?: Version,
|
|
40
|
-
|};
|
|
41
|
-
declare type State = {|
|
|
42
|
-
json: PerseusJson,
|
|
43
|
-
gradeMessage: string,
|
|
44
|
-
wasAnswered: boolean,
|
|
45
|
-
highlightLint: boolean,
|
|
46
|
-
|};
|
|
47
|
-
declare class EditorPage extends React.Component<Props, State> {
|
|
48
|
-
_isMounted: boolean;
|
|
49
|
-
rendererMountNode: HTMLDivElement;
|
|
50
|
-
renderer: RendererInterface | null | void;
|
|
51
|
-
static defaultProps: {|
|
|
52
|
-
developerMode: boolean,
|
|
53
|
-
jsonMode: boolean,
|
|
54
|
-
onChange: () => void,
|
|
55
|
-
|};
|
|
56
|
-
constructor(props: Props): this;
|
|
57
|
-
componentDidMount(): void;
|
|
58
|
-
componentDidUpdate(): void;
|
|
59
|
-
componentWillUnmount(): void;
|
|
60
|
-
toggleJsonMode: () => void;
|
|
61
|
-
updateRenderer(): void;
|
|
62
|
-
getApiOptions(): APIOptionsWithDefaults;
|
|
63
|
-
getSaveWarnings(): any;
|
|
64
|
-
serialize(options?: {|
|
|
65
|
-
keepDeletedWidgets?: boolean,
|
|
66
|
-
|}): any | PerseusJson;
|
|
67
|
-
handleChange: ChangeHandler;
|
|
68
|
-
changeJSON: (newJson: PerseusJson) => void;
|
|
69
|
-
scorePreview(): KEScore | null | void;
|
|
70
|
-
render(): React.Node;
|
|
71
|
-
}
|
|
72
|
-
declare export default typeof EditorPage;
|
package/dist/editor.js.flow
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import "./katex-mhchem";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import type { ChangeHandler, WidgetInfo } from "@khanacademy/perseus";
|
|
10
|
-
declare type Props = $ReadOnly<{|
|
|
11
|
-
apiOptions: any,
|
|
12
|
-
className?: string,
|
|
13
|
-
content: string,
|
|
14
|
-
replace?: any,
|
|
15
|
-
placeholder: string,
|
|
16
|
-
widgets: {
|
|
17
|
-
[name: string]: WidgetInfo,
|
|
18
|
-
},
|
|
19
|
-
images: any,
|
|
20
|
-
disabled: boolean,
|
|
21
|
-
widgetEnabled: boolean,
|
|
22
|
-
immutableWidgets: boolean,
|
|
23
|
-
showWordCount: boolean,
|
|
24
|
-
warnNoPrompt: boolean,
|
|
25
|
-
warnNoWidgets: boolean,
|
|
26
|
-
imageUploader?: (file: string, callback: (url: string) => mixed) => mixed,
|
|
27
|
-
onChange: ChangeHandler,
|
|
28
|
-
|}>;
|
|
29
|
-
declare type DeafultProps = {|
|
|
30
|
-
content: string,
|
|
31
|
-
disabled: boolean,
|
|
32
|
-
images: { [key: any]: any },
|
|
33
|
-
immutableWidgets: boolean,
|
|
34
|
-
placeholder: string,
|
|
35
|
-
showWordCount: boolean,
|
|
36
|
-
warnNoPrompt: boolean,
|
|
37
|
-
warnNoWidgets: boolean,
|
|
38
|
-
widgetEnabled: boolean,
|
|
39
|
-
widgets: {
|
|
40
|
-
[name: string]: WidgetInfo,
|
|
41
|
-
},
|
|
42
|
-
|};
|
|
43
|
-
declare type State = {|
|
|
44
|
-
textAreaValue: string,
|
|
45
|
-
|};
|
|
46
|
-
declare class Editor extends React.Component<Props, State> {
|
|
47
|
-
lastUserValue: string | null | void;
|
|
48
|
-
deferredChange: any | null | void;
|
|
49
|
-
widgetIds: any | null | void;
|
|
50
|
-
static defaultProps: DeafultProps;
|
|
51
|
-
state: State;
|
|
52
|
-
componentDidMount(): void;
|
|
53
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
54
|
-
componentDidUpdate(prevProps: Props): void;
|
|
55
|
-
componentWillUnmount(): void;
|
|
56
|
-
getWidgetEditor: (id: string, type: string) => void | React.Node;
|
|
57
|
-
_handleWidgetEditorChange: (
|
|
58
|
-
id: string,
|
|
59
|
-
newWidgetInfo: WidgetInfo,
|
|
60
|
-
cb?: () => mixed,
|
|
61
|
-
silent?: boolean
|
|
62
|
-
) => void;
|
|
63
|
-
_handleWidgetEditorRemove: (id: string) => void;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Calculate the size of all the images in props.content, and send
|
|
67
|
-
* those sizes to this.props.images using props.onChange.
|
|
68
|
-
*/
|
|
69
|
-
_sizeImages: (props: Props) => void;
|
|
70
|
-
handleDrop: (e: DragEvent) => void;
|
|
71
|
-
handleChange: (e: SyntheticEvent<HTMLTextAreaElement>) => void;
|
|
72
|
-
_handleKeyDown: (e: SyntheticKeyboardEvent<HTMLTextAreaElement>) => void;
|
|
73
|
-
_maybeCopyWidgets: (e: SyntheticEvent<HTMLTextAreaElement>) => void;
|
|
74
|
-
_maybePasteWidgets: (e: SyntheticEvent<HTMLTextAreaElement>) => void;
|
|
75
|
-
_safeWidgetNameMapping: (widgetData: {
|
|
76
|
-
[name: string]: any,
|
|
77
|
-
}) => { [key: any]: any };
|
|
78
|
-
_addWidgetToContent: (
|
|
79
|
-
oldContent: string,
|
|
80
|
-
cursorRange: $ReadOnlyArray<number>,
|
|
81
|
-
widgetType: string
|
|
82
|
-
) => void;
|
|
83
|
-
_addWidget: (widgetType: string) => void;
|
|
84
|
-
addTemplate: (e: SyntheticEvent<HTMLTextAreaElement>) => void;
|
|
85
|
-
getSaveWarnings: () => any;
|
|
86
|
-
focus: () => void;
|
|
87
|
-
focusAndMoveToEnd: () => void;
|
|
88
|
-
serialize: (options?: any) => {|
|
|
89
|
-
content: string,
|
|
90
|
-
images: any,
|
|
91
|
-
replace: any | void,
|
|
92
|
-
widgets: { [key: any]: any },
|
|
93
|
-
|};
|
|
94
|
-
render(): React.Node;
|
|
95
|
-
}
|
|
96
|
-
declare export default typeof Editor;
|
package/dist/hint-editor.js.flow
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import type {
|
|
9
|
-
APIOptions,
|
|
10
|
-
WidgetDict,
|
|
11
|
-
ImageDict,
|
|
12
|
-
Hint,
|
|
13
|
-
ChangeHandler,
|
|
14
|
-
DeviceType,
|
|
15
|
-
} from "@khanacademy/perseus";
|
|
16
|
-
declare type ImageUploader = (
|
|
17
|
-
file: string,
|
|
18
|
-
callback: (url: string) => mixed
|
|
19
|
-
) => mixed;
|
|
20
|
-
declare type HintEditorProps = {|
|
|
21
|
-
itemId?: string,
|
|
22
|
-
apiOptions?: APIOptions,
|
|
23
|
-
className: string,
|
|
24
|
-
imageUploader?: ImageUploader,
|
|
25
|
-
showMoveButtons?: boolean,
|
|
26
|
-
showRemoveButton?: boolean,
|
|
27
|
-
showTitle?: boolean,
|
|
28
|
-
content?: string | null | void,
|
|
29
|
-
replace?: boolean | null | void,
|
|
30
|
-
widgets?: WidgetDict | null | void,
|
|
31
|
-
images?: ImageDict | null | void,
|
|
32
|
-
isLast: boolean,
|
|
33
|
-
isFirst: boolean,
|
|
34
|
-
onMove: (direction: number) => mixed,
|
|
35
|
-
onRemove: () => mixed,
|
|
36
|
-
onChange: ChangeHandler,
|
|
37
|
-
__type?: "hint",
|
|
38
|
-
|};
|
|
39
|
-
declare export class HintEditor extends React.Component<HintEditorProps> {
|
|
40
|
-
static defaultProps: {|
|
|
41
|
-
className: string,
|
|
42
|
-
content: string,
|
|
43
|
-
replace: boolean,
|
|
44
|
-
showMoveButtons: boolean,
|
|
45
|
-
showRemoveButton: boolean,
|
|
46
|
-
showTitle: boolean,
|
|
47
|
-
|};
|
|
48
|
-
handleChange: (e: SyntheticInputEvent<HTMLInputElement>) => void;
|
|
49
|
-
focus: () => void;
|
|
50
|
-
getSaveWarnings: () => any;
|
|
51
|
-
serialize: (options?: any) => any;
|
|
52
|
-
render(): React.Node;
|
|
53
|
-
}
|
|
54
|
-
declare type CombinedHintsEditorProps = {|
|
|
55
|
-
apiOptions?: APIOptions,
|
|
56
|
-
deviceType: DeviceType,
|
|
57
|
-
imageUploader?: ImageUploader,
|
|
58
|
-
highlightLint?: boolean,
|
|
59
|
-
hints: $ReadOnlyArray<Hint>,
|
|
60
|
-
previewURL: string,
|
|
61
|
-
onChange: ChangeHandler,
|
|
62
|
-
itemId?: string,
|
|
63
|
-
|};
|
|
64
|
-
declare class CombinedHintsEditor
|
|
65
|
-
extends React.Component<CombinedHintsEditorProps>
|
|
66
|
-
{
|
|
67
|
-
static HintEditor: typeof HintEditor;
|
|
68
|
-
static defaultProps: {|
|
|
69
|
-
highlightLint: boolean,
|
|
70
|
-
hints: $ReadOnlyArray<any>,
|
|
71
|
-
onChange: () => void,
|
|
72
|
-
|};
|
|
73
|
-
handleHintChange: (
|
|
74
|
-
i: number,
|
|
75
|
-
newProps: CombinedHintsEditorProps,
|
|
76
|
-
cb: () => mixed,
|
|
77
|
-
silent: boolean
|
|
78
|
-
) => void;
|
|
79
|
-
handleHintRemove: (i: number) => void;
|
|
80
|
-
handleHintMove: (i: number, dir: number) => void;
|
|
81
|
-
addHint: () => void;
|
|
82
|
-
getSaveWarnings: () => any;
|
|
83
|
-
serialize: (options?: any) => $ReadOnlyArray<string>;
|
|
84
|
-
serializeHint: (index: number, options?: any) => string;
|
|
85
|
-
render(): React.Node;
|
|
86
|
-
}
|
|
87
|
-
declare export default typeof CombinedHintsEditor;
|
package/dist/i18n.js.flow
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
declare function findImagesInItemData(itemData: any): any;
|
|
8
|
-
declare function findImagesInArticles(perseusContent: any): any;
|
|
9
|
-
declare var _default: {|
|
|
10
|
-
findImagesInArticles: typeof findImagesInArticles,
|
|
11
|
-
findImagesInItemData: typeof findImagesInItemData,
|
|
12
|
-
|};
|
|
13
|
-
declare export default typeof _default;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
declare type Props = {|
|
|
9
|
-
url: string,
|
|
10
|
-
datasetKey: string,
|
|
11
|
-
datasetValue: any,
|
|
12
|
-
seamless: boolean,
|
|
13
|
-
|};
|
|
14
|
-
declare class IframeContentRenderer extends React.Component<Props> {
|
|
15
|
-
_frame: HTMLIFrameElement | null | void;
|
|
16
|
-
_isMounted: boolean;
|
|
17
|
-
_lastData: any;
|
|
18
|
-
_lastHeight: number;
|
|
19
|
-
iframeID: number;
|
|
20
|
-
componentDidMount(): void;
|
|
21
|
-
shouldComponentUpdate(nextProps: Props): boolean;
|
|
22
|
-
componentDidUpdate(prevProps: Props): void;
|
|
23
|
-
componentWillUnmount(): void;
|
|
24
|
-
_prepareFrame(): void;
|
|
25
|
-
sendNewData(data: any): void;
|
|
26
|
-
render(): React.Node;
|
|
27
|
-
}
|
|
28
|
-
declare export default typeof IframeContentRenderer;
|
package/dist/index.js.flow
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
declare export { default as ArticleEditor } from "./article-editor";
|
|
8
|
-
declare export { default as DeviceFramer } from "./components/device-framer";
|
|
9
|
-
declare export { default as ViewportResizer } from "./components/viewport-resizer";
|
|
10
|
-
declare export { default as ArticleDiff } from "./diffs/article-diff";
|
|
11
|
-
declare export { default as ItemDiff } from "./diffs/item-diff";
|
|
12
|
-
declare export { default as StructuredItemDiff } from "./diffs/structured-item-diff";
|
|
13
|
-
declare export { default as EditorPage } from "./editor-page";
|
|
14
|
-
declare export { default as Editor } from "./editor";
|
|
15
|
-
declare export { default as i18n } from "./i18n";
|
|
16
|
-
declare export { default as IframeContentRenderer } from "./iframe-content-renderer";
|
|
17
|
-
declare export { default as MultiRendererEditor } from "./multirenderer-editor";
|
|
18
|
-
declare export { default as StatefulArticleEditor } from "./stateful-article-editor";
|
|
19
|
-
declare export { default as StatefulEditorPage } from "./stateful-editor-page";
|
|
20
|
-
import "./styles/perseus-editor.less";
|
|
21
|
-
import AllEditors from "./all-editors";
|
|
22
|
-
import AllWidgets from "./all-widgets";
|
|
23
|
-
declare export { AllEditors, AllWidgets };
|
package/dist/item-editor.js.flow
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import type {
|
|
9
|
-
APIOptions,
|
|
10
|
-
ImageUploader,
|
|
11
|
-
ChangeHandler,
|
|
12
|
-
} from "@khanacademy/perseus";
|
|
13
|
-
declare type Props = {|
|
|
14
|
-
apiOptions?: APIOptions,
|
|
15
|
-
deviceType?: string,
|
|
16
|
-
gradeMessage?: string,
|
|
17
|
-
imageUploader?: ImageUploader,
|
|
18
|
-
wasAnswered?: boolean,
|
|
19
|
-
question?: any,
|
|
20
|
-
answerArea?: any,
|
|
21
|
-
previewURL: string,
|
|
22
|
-
onChange: ChangeHandler,
|
|
23
|
-
itemId?: string,
|
|
24
|
-
|};
|
|
25
|
-
declare class ItemEditor extends React.Component<Props> {
|
|
26
|
-
static defaultProps: {|
|
|
27
|
-
answerArea: { [key: any]: any },
|
|
28
|
-
onChange: () => void,
|
|
29
|
-
question: { [key: any]: any },
|
|
30
|
-
|};
|
|
31
|
-
updateProps: ChangeHandler;
|
|
32
|
-
triggerPreviewUpdate: (newData?: any) => void;
|
|
33
|
-
handleEditorChange: ChangeHandler;
|
|
34
|
-
handleItemExtrasChange: ChangeHandler;
|
|
35
|
-
getSaveWarnings: () => any;
|
|
36
|
-
serialize: (options?: any) => {|
|
|
37
|
-
answerArea: any,
|
|
38
|
-
itemDataVersion: {|
|
|
39
|
-
major: number,
|
|
40
|
-
minor: number,
|
|
41
|
-
|},
|
|
42
|
-
question: any,
|
|
43
|
-
|};
|
|
44
|
-
render(): React.Node;
|
|
45
|
-
}
|
|
46
|
-
declare export default typeof ItemEditor;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
3
|
-
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.21.0
|
|
5
|
-
* @flow
|
|
6
|
-
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
declare type Props = any;
|
|
10
|
-
declare class ItemExtrasEditor extends React.Component<Props> {
|
|
11
|
-
static propTypes: {|
|
|
12
|
-
calculator: PropTypes.Requireable<boolean>,
|
|
13
|
-
chi2Table: PropTypes.Requireable<boolean>,
|
|
14
|
-
onChange: PropTypes.Validator<(...args: any[]) => any>,
|
|
15
|
-
periodicTable: PropTypes.Requireable<boolean>,
|
|
16
|
-
tTable: PropTypes.Requireable<boolean>,
|
|
17
|
-
zTable: PropTypes.Requireable<boolean>,
|
|
18
|
-
|};
|
|
19
|
-
static defaultProps: Props;
|
|
20
|
-
serialize: () => any;
|
|
21
|
-
render(): React.Node;
|
|
22
|
-
}
|
|
23
|
-
declare export default typeof ItemExtrasEditor;
|