@khanacademy/perseus 46.0.1 → 47.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.
@@ -1,73 +0,0 @@
1
- /**
2
- * This library provides support for Perseus multi-items: structured Perseus
3
- * content that content creators can easily create, and that applications can
4
- * easily render into different parts of the layout.
5
- *
6
- * For more details about application and motivation, see:
7
- * https://sites.google.com/a/khanacademy.org/forge/for-developers/perseus-items-and-multi-items
8
- *
9
- * This file primarily exposes the `MultiRenderer` component, which performs
10
- * multi-rendering. To multi-render a question, pass in the content of the item
11
- * to the `MultiRenderer` component as a props. Then, pass in a function which
12
- * takes an object of renderers (in the same structure as the content), and
13
- * return a render tree. The `MultiRenderer` component will allow you to
14
- * combine scores, serialized state, etc. without having to manually call on
15
- * each of the functions. It also handles inter-widgets requests between the
16
- * different renderers.
17
- * For more details, see `multi-items/multi-renderer.jsx`.
18
- *
19
- * Example:
20
- *
21
- * item = {_multi: {
22
- * left: <content data>,
23
- * right: [<content data>, <content data>],
24
- * }}
25
- * shape = shapes.shape({
26
- * left: shapes.content,
27
- * right: shapes.arrayOf(shapes.content),
28
- * })
29
- *
30
- * <MultiRenderer item={item} shape={shape}>
31
- * {({renderers}) =>
32
- * <div>
33
- * <div id="left">{renderers.left}</div>
34
- * <ul id="right">
35
- * {renderers.right.map(r => <li>{r}</li>)}
36
- * </ul>
37
- * </div>
38
- * }
39
- * </MultiRenderer>
40
- *
41
- * This file also exposes `shapes`, which helps you construct a runtime type
42
- * declaration for your particular class of multi-item. This can then be used
43
- * to create a MultirendererEditor for your multi-item shape, and to validate
44
- * that a multi-item conforms to the shape via `buildPropTypeForShape`.
45
- * For more details, see `multi-items/shapes.js`.
46
- *
47
- * This file also exposes some utility functions for working with generic
48
- * multi-items, like `findContentNodesInItem`, `findHintNodesInItem`,
49
- * `inferItemShape`, and `buildEmptyItemForShape`.
50
- * For more details, see `multi-items/items.js`.
51
- */
52
- import { buildEmptyItemForShape, findContentNodesInItem, findHintNodesInItem, inferItemShape } from "./multi-items/items";
53
- import MultiRenderer from "./multi-items/multi-renderer";
54
- import { buildPropTypeForShape } from "./multi-items/prop-type-builders";
55
- declare const _default: {
56
- MultiRenderer: typeof MultiRenderer;
57
- shapes: {
58
- content: import(".").ContentShape;
59
- hint: import(".").HintShape;
60
- hints: import(".").ArrayShape;
61
- tags: import(".").TagsShape;
62
- arrayOf: (elementShape: import(".").Shape) => import(".").ArrayShape;
63
- shape: (shape: {
64
- [k: string]: import(".").Shape;
65
- }) => import(".").ObjectShape;
66
- };
67
- buildPropTypeForShape: typeof buildPropTypeForShape;
68
- buildEmptyItemForShape: typeof buildEmptyItemForShape;
69
- findContentNodesInItem: typeof findContentNodesInItem;
70
- findHintNodesInItem: typeof findHintNodesInItem;
71
- inferItemShape: typeof inferItemShape;
72
- };
73
- export default _default;