@khanacademy/perseus-editor 31.3.0 → 32.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preview/message-types.d.ts +12 -4
- package/dist/preview-with-iframe.d.ts +42 -0
- package/package.json +41 -41
|
@@ -4,7 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { APIOptions, DeviceType } from "@khanacademy/perseus";
|
|
6
6
|
import type { Hint, PerseusArticle, PerseusItem } from "@khanacademy/perseus-core";
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The subset of `LinterContextProps` that's meaningful to send across the
|
|
9
|
+
* preview bridge. The receiver wraps this in `pushContextStack(...)` before
|
|
10
|
+
* passing it to the renderer, which fills in the `stack`.
|
|
11
|
+
*/
|
|
12
|
+
type PreviewLinterContext = {
|
|
13
|
+
contentType: string;
|
|
14
|
+
highlightLint: boolean;
|
|
15
|
+
};
|
|
8
16
|
/**
|
|
9
17
|
* Constant identifier for all Perseus preview messages
|
|
10
18
|
*/
|
|
@@ -23,7 +31,7 @@ export type QuestionPreviewData = {
|
|
|
23
31
|
apiOptions: APIOptions;
|
|
24
32
|
initialHintsVisible: number;
|
|
25
33
|
device: DeviceType;
|
|
26
|
-
linterContext:
|
|
34
|
+
linterContext: PreviewLinterContext;
|
|
27
35
|
reviewMode?: boolean;
|
|
28
36
|
legacyPerseusLint?: ReadonlyArray<string>;
|
|
29
37
|
problemNum?: number;
|
|
@@ -35,7 +43,7 @@ export type HintPreviewData = {
|
|
|
35
43
|
hint: Hint;
|
|
36
44
|
pos: number;
|
|
37
45
|
apiOptions: APIOptions;
|
|
38
|
-
linterContext:
|
|
46
|
+
linterContext: PreviewLinterContext;
|
|
39
47
|
};
|
|
40
48
|
/**
|
|
41
49
|
* Data for article section preview
|
|
@@ -43,7 +51,7 @@ export type HintPreviewData = {
|
|
|
43
51
|
export type ArticlePreviewData = {
|
|
44
52
|
apiOptions: APIOptions;
|
|
45
53
|
json: PerseusArticle;
|
|
46
|
-
linterContext:
|
|
54
|
+
linterContext: PreviewLinterContext;
|
|
47
55
|
legacyPerseusLint?: ReadonlyArray<string>;
|
|
48
56
|
};
|
|
49
57
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PreviewContent } from "./preview/message-types";
|
|
3
|
+
type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The URL that the iframe should load
|
|
6
|
+
*/
|
|
7
|
+
url: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the iframe should be displaying in mobile mode
|
|
10
|
+
*/
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to make the iframe's height match its content's height, used to
|
|
14
|
+
* prevent scrolling inside the iframe.
|
|
15
|
+
*/
|
|
16
|
+
seamless: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The content to render in the preview area.
|
|
19
|
+
*/
|
|
20
|
+
content: PreviewContent;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Displays content in an iframe, isolating it from the parent page and
|
|
24
|
+
* switches to rendering for mobile, if needed.
|
|
25
|
+
*
|
|
26
|
+
* To simulate the environment of content rendered by itself, content previews
|
|
27
|
+
* are rendered inside iframes, where components such as the math keypad and
|
|
28
|
+
* mobile breakpoints based on media queries work (because the body of the
|
|
29
|
+
* document is not the body of the editor). To make this work, this component
|
|
30
|
+
* renders an iframe and communicates with it via the
|
|
31
|
+
* {@link usePreviewController} hook and its use of postMessage.
|
|
32
|
+
*
|
|
33
|
+
* This is the new preview iframe component, replacing `IframeContentRenderer`
|
|
34
|
+
* once all editors have migrated. It exists alongside the legacy component so
|
|
35
|
+
* that consumers can keep using `IframeContentRenderer` until they are all
|
|
36
|
+
* ported over.
|
|
37
|
+
*/
|
|
38
|
+
declare function PreviewWithIframe(props: Props): React.JSX.Element;
|
|
39
|
+
declare namespace PreviewWithIframe {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
export default PreviewWithIframe;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Perseus editors",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "32.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
"mafs": "^0.19.0",
|
|
37
37
|
"tiny-invariant": "1.3.1",
|
|
38
38
|
"@khanacademy/kas": "2.2.3",
|
|
39
|
-
"@khanacademy/keypad-context": "3.2.
|
|
40
|
-
"@khanacademy/kmath": "2.4.
|
|
41
|
-
"@khanacademy/math-input": "26.4.
|
|
42
|
-
"@khanacademy/perseus": "77.6.
|
|
43
|
-
"@khanacademy/perseus-core": "26.
|
|
44
|
-
"@khanacademy/perseus-linter": "5.0.
|
|
45
|
-
"@khanacademy/perseus-score": "8.
|
|
39
|
+
"@khanacademy/keypad-context": "3.2.53",
|
|
40
|
+
"@khanacademy/kmath": "2.4.11",
|
|
41
|
+
"@khanacademy/math-input": "26.4.25",
|
|
42
|
+
"@khanacademy/perseus": "77.6.2",
|
|
43
|
+
"@khanacademy/perseus-core": "26.3.1",
|
|
44
|
+
"@khanacademy/perseus-linter": "5.0.8",
|
|
45
|
+
"@khanacademy/perseus-score": "8.10.1",
|
|
46
46
|
"@khanacademy/perseus-utils": "2.1.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@khanacademy/mathjax-renderer": "3.0.0",
|
|
50
|
-
"@khanacademy/wonder-blocks-accordion": "3.1.
|
|
51
|
-
"@khanacademy/wonder-blocks-banner": "5.0.
|
|
52
|
-
"@khanacademy/wonder-blocks-button": "11.5.
|
|
53
|
-
"@khanacademy/wonder-blocks-clickable": "8.1.
|
|
50
|
+
"@khanacademy/wonder-blocks-accordion": "3.1.56",
|
|
51
|
+
"@khanacademy/wonder-blocks-banner": "5.0.21",
|
|
52
|
+
"@khanacademy/wonder-blocks-button": "11.5.2",
|
|
53
|
+
"@khanacademy/wonder-blocks-clickable": "8.1.7",
|
|
54
54
|
"@khanacademy/wonder-blocks-core": "12.4.3",
|
|
55
|
-
"@khanacademy/wonder-blocks-dropdown": "10.8.
|
|
56
|
-
"@khanacademy/wonder-blocks-form": "7.5.
|
|
57
|
-
"@khanacademy/wonder-blocks-icon": "5.3.
|
|
58
|
-
"@khanacademy/wonder-blocks-icon-button": "11.2.
|
|
59
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.0.
|
|
60
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
61
|
-
"@khanacademy/wonder-blocks-link": "10.1.
|
|
62
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
63
|
-
"@khanacademy/wonder-blocks-switch": "3.3.
|
|
55
|
+
"@khanacademy/wonder-blocks-dropdown": "10.8.7",
|
|
56
|
+
"@khanacademy/wonder-blocks-form": "7.5.8",
|
|
57
|
+
"@khanacademy/wonder-blocks-icon": "5.3.11",
|
|
58
|
+
"@khanacademy/wonder-blocks-icon-button": "11.2.2",
|
|
59
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.0.18",
|
|
60
|
+
"@khanacademy/wonder-blocks-layout": "3.1.48",
|
|
61
|
+
"@khanacademy/wonder-blocks-link": "10.1.9",
|
|
62
|
+
"@khanacademy/wonder-blocks-pill": "3.1.60",
|
|
63
|
+
"@khanacademy/wonder-blocks-switch": "3.3.32",
|
|
64
64
|
"@khanacademy/wonder-blocks-timing": "7.0.4",
|
|
65
|
-
"@khanacademy/wonder-blocks-tokens": "16.
|
|
66
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
67
|
-
"@khanacademy/wonder-blocks-typography": "4.3.
|
|
65
|
+
"@khanacademy/wonder-blocks-tokens": "16.3.0",
|
|
66
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.72",
|
|
67
|
+
"@khanacademy/wonder-blocks-typography": "4.3.1",
|
|
68
68
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
69
69
|
"@phosphor-icons/core": "2.0.2",
|
|
70
70
|
"aphrodite": "1.2.5",
|
|
@@ -79,24 +79,24 @@
|
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@khanacademy/mathjax-renderer": "^3.0.0",
|
|
82
|
-
"@khanacademy/wonder-blocks-accordion": "^3.1.
|
|
83
|
-
"@khanacademy/wonder-blocks-banner": "^5.0.
|
|
84
|
-
"@khanacademy/wonder-blocks-button": "^11.5.
|
|
85
|
-
"@khanacademy/wonder-blocks-clickable": "^8.1.
|
|
82
|
+
"@khanacademy/wonder-blocks-accordion": "^3.1.56",
|
|
83
|
+
"@khanacademy/wonder-blocks-banner": "^5.0.21",
|
|
84
|
+
"@khanacademy/wonder-blocks-button": "^11.5.2",
|
|
85
|
+
"@khanacademy/wonder-blocks-clickable": "^8.1.7",
|
|
86
86
|
"@khanacademy/wonder-blocks-core": "^12.4.3",
|
|
87
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.8.
|
|
88
|
-
"@khanacademy/wonder-blocks-form": "^7.5.
|
|
89
|
-
"@khanacademy/wonder-blocks-icon": "^5.3.
|
|
90
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.2.
|
|
91
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.0.
|
|
92
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
93
|
-
"@khanacademy/wonder-blocks-link": "^10.1.
|
|
94
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
95
|
-
"@khanacademy/wonder-blocks-switch": "^3.3.
|
|
87
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.8.7",
|
|
88
|
+
"@khanacademy/wonder-blocks-form": "^7.5.8",
|
|
89
|
+
"@khanacademy/wonder-blocks-icon": "^5.3.11",
|
|
90
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.2.2",
|
|
91
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.0.18",
|
|
92
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.48",
|
|
93
|
+
"@khanacademy/wonder-blocks-link": "^10.1.9",
|
|
94
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.60",
|
|
95
|
+
"@khanacademy/wonder-blocks-switch": "^3.3.32",
|
|
96
96
|
"@khanacademy/wonder-blocks-timing": "^7.0.4",
|
|
97
|
-
"@khanacademy/wonder-blocks-tokens": "^16.
|
|
98
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
99
|
-
"@khanacademy/wonder-blocks-typography": "^4.3.
|
|
97
|
+
"@khanacademy/wonder-blocks-tokens": "^16.3.0",
|
|
98
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.72",
|
|
99
|
+
"@khanacademy/wonder-blocks-typography": "^4.3.1",
|
|
100
100
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
101
101
|
"@phosphor-icons/core": "^2.0.2",
|
|
102
102
|
"aphrodite": "^1.2.5",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"keywords": [],
|
|
111
111
|
"khan": {
|
|
112
|
-
"catalogHash": "
|
|
112
|
+
"catalogHash": "0b097526eed5a522"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {}
|
|
115
115
|
}
|