@khanacademy/perseus-editor 25.0.4 → 25.1.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/editor-page.d.ts +25 -0
- package/dist/editor.d.ts +2 -0
- package/dist/es/index.css +1 -1
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +5 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/item-editor.d.ts +8 -0
- package/dist/widgets/radio/editor.d.ts +1 -3
- package/package.json +12 -12
package/dist/editor-page.d.ts
CHANGED
|
@@ -5,21 +5,46 @@ import type { Issue } from "./issues-panel";
|
|
|
5
5
|
import type { APIOptions, APIOptionsWithDefaults, ChangeHandler, DeviceType, ImageUploader } from "@khanacademy/perseus";
|
|
6
6
|
import type { Hint, PerseusAnswerArea, PerseusItem, PerseusRenderer } from "@khanacademy/perseus-core";
|
|
7
7
|
type Props = {
|
|
8
|
+
/** Additional templates that the host application would like to display
|
|
9
|
+
* within the Perseus Editor.
|
|
10
|
+
*/
|
|
11
|
+
additionalTemplates?: Record<string, string>;
|
|
8
12
|
apiOptions?: APIOptions;
|
|
9
13
|
answerArea?: PerseusAnswerArea | null;
|
|
10
14
|
contentPaths?: ReadonlyArray<string>;
|
|
15
|
+
/** "Power user" mode. Shows the raw JSON of the question. */
|
|
11
16
|
developerMode: boolean;
|
|
17
|
+
/** Source HTML for the iframe to render */
|
|
12
18
|
frameSource: string;
|
|
13
19
|
hints?: ReadonlyArray<Hint>;
|
|
20
|
+
/** A function which takes a file object (guaranteed to be an image) and
|
|
21
|
+
* a callback, then calls the callback with the url where the image
|
|
22
|
+
* will be hosted. Image drag and drop is disabled when imageUploader
|
|
23
|
+
* is null.
|
|
24
|
+
*/
|
|
14
25
|
imageUploader?: ImageUploader;
|
|
26
|
+
/** The content ID of the AssessmentItem being edited. */
|
|
15
27
|
itemId: string;
|
|
28
|
+
/** Whether the question is displaying as JSON or if it is
|
|
29
|
+
* showing the editor itself with the rendering
|
|
30
|
+
* Only used in the perseus demos. Consider removing.
|
|
31
|
+
*/
|
|
16
32
|
jsonMode: boolean;
|
|
33
|
+
/** A function which is called with the new JSON blob of content. */
|
|
17
34
|
onChange: ChangeHandler;
|
|
35
|
+
/** A function which is called when the preview device changes. */
|
|
18
36
|
onPreviewDeviceChange: (arg1: DeviceType) => unknown;
|
|
19
37
|
previewDevice: DeviceType;
|
|
38
|
+
/** A global control to expand/collapse all widget editors on a page. */
|
|
20
39
|
widgetsAreOpen?: boolean;
|
|
40
|
+
/** Initial value of the question being edited. */
|
|
21
41
|
question?: PerseusRenderer;
|
|
42
|
+
/** URL of the route to show on initial load of the preview frames. */
|
|
22
43
|
previewURL: string;
|
|
44
|
+
/** Additional issues that the host application would like to display
|
|
45
|
+
* within the Perseus Editor. This allows the hosts to present issues
|
|
46
|
+
* with the content that aren't linted/detected by Perseus itself.
|
|
47
|
+
*/
|
|
23
48
|
issues?: Issue[];
|
|
24
49
|
};
|
|
25
50
|
type DefaultProps = {
|
package/dist/editor.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import type { ChangeHandler, ImageUploader } from "@khanacademy/perseus";
|
|
4
4
|
import type { PerseusWidget, PerseusWidgetsMap } from "@khanacademy/perseus-core";
|
|
5
5
|
type Props = Readonly<{
|
|
6
|
+
additionalTemplates: Record<string, string>;
|
|
6
7
|
apiOptions: any;
|
|
7
8
|
className?: string;
|
|
8
9
|
content: string;
|
|
@@ -33,6 +34,7 @@ type DefaultProps = {
|
|
|
33
34
|
widgets: {
|
|
34
35
|
[name: string]: PerseusWidget;
|
|
35
36
|
};
|
|
37
|
+
additionalTemplates: Props["additionalTemplates"];
|
|
36
38
|
};
|
|
37
39
|
type State = {
|
|
38
40
|
textAreaValue: string;
|
package/dist/es/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
code{font-family:Courier,monospace}.pod-title{background-color:#eee;border:1px solid #ddd;border-bottom:0;border-radius:3px 3px 0 0;font-size:1.25em;padding:4px 10px}.pod-title.closed{border-radius:3px}.smiley{left:0;position:absolute;top:4px}.perseus-single-editor{box-sizing:border-box;width:100%}.perseus-json-editor{font-family:monospace;height:500px;width:100%}.perseus-json-editor.invalid{background-color:#ffe6e6}.perseus-textarea-pair{border:1px solid #ddd;font-size:12px;line-height:1.6;position:relative}.perseus-textarea-pair>.perseus-textarea-underlay{word-wrap:break-word;color:transparent;margin-bottom:12px;padding:10px;white-space:pre-wrap}.perseus-textarea-pair>.perseus-textarea-underlay b{background-color:#dfd;font-weight:400}.perseus-textarea-pair>.perseus-textarea-underlay b.selected{background-color:#ddf}.perseus-textarea-pair>.perseus-textarea-underlay b.error{background-color:#fcc}.perseus-textarea-pair>textarea{background:transparent;border:0;box-sizing:border-box;font:inherit;height:100%;left:0;overflow:hidden;padding:10px;position:absolute;resize:none;top:0;width:100%}.perseus-widget-row{margin:7px 0;width:100%}.perseus-widget-row .perseus-widget-left-col,.perseus-widget-row .perseus-widget-right-col{display:inline-block;width:50%}.perseus-widget-row .perseus-widget-left-col .range-input,.perseus-widget-row .perseus-widget-right-col .range-input{float:right;margin-right:5px}.perseus-widget-row>.range-input{margin-left:10px}.perseus-answer-options{border:1px solid #ddd;padding:10px}.perseus-answer-options *{margin-bottom:4px}.perseus-answer-widget{border:1px solid #ddd;border-radius:0 0 3px 3px;padding:10px}.perseus-answer-none{border-bottom:1px solid #ddd}.perseus-answer-none>div{display:none}.perseus-widget-editor{border:1px solid #ddd;border-radius:3px;margin-top:10px}.perseus-widget-editor .perseus-widget-editor-title{align-items:center;background-color:#eee;border:0;border-radius:3px 3px 0 0;cursor:pointer;display:flex;font-size:1.25em;padding:4px 10px;position:relative}.perseus-widget-editor .perseus-widget-editor-title.closed{border-radius:3px}.perseus-widget-editor .perseus-widget-editor-title :first-child{flex-grow:1}.perseus-widget-editor .perseus-widget-editor-title>a{color:inherit;text-decoration:none}.perseus-widget-editor .perseus-widget-editor-title .alignment{margin-right:5px}.perseus-widget-editor .perseus-widget-editor-title .simple-button{font-size:13px;padding:0 10px}.perseus-widget-editor .perseus-widget-editor-content{border-radius:0 0 3px 3px;border-top:1px solid #ddd;padding:10px;transition:all 0s}.perseus-widget-editor .perseus-widget-editor-content.leave{display:none}.perseus-widget-editor .perseus-widget-editor-content .inline-options{float:inline-start;line-height:24px;padding-inline-end:.5em}.perseus-widget-editor .perseus-widget-editor-content .tooltip-for-legend{display:inline-block;line-height:24px}.perseus-widget-editor .categorizer-container{overflow-x:scroll}.perseus-widget-editor .section-accordion{display:flex;flex-direction:row}.perseus-widget-editor .delete-item-button{align-self:center;padding-right:.5em}.perseus-widget-editor-title-id{align-items:center;display:inline-flex}.perseus-widget-editor-title-id>svg{float:left;font-size:14px;margin-right:10px}.perseus-editor-accordion-container{display:inline-grid;width:100%}.perseus-editor-accordion-container.collapsed{grid-template-rows:0fr;min-height:0;transition:all .25s step-end,grid-template-rows .25s;visibility:hidden}.perseus-editor-accordion-container.expanded{grid-template-rows:1fr;min-height:100%;transition:grid-template-rows .5s;visibility:visible}.perseus-editor-accordion-container .perseus-editor-accordion-content{margin:0 -1px;overflow:hidden;padding:0 1px}.perseus-editor-widgets-selectors{background-color:#eee;border:1px solid #ddd;border-radius:0 0 3px 3px;border-top:0;display:flex;flex-wrap:wrap;padding:10px/2}.perseus-editor-widgets-selectors select{margin:2px}.perseus-editor-widgets>div.selected>strong{background-color:#ddf}.perseus-editor-widgets .warning{background-color:#fcc;margin:4px;padding:4px}.perseus-editor-word-count{cursor:help;flex:1;float:right;margin-right:3px;margin-top:2px;text-align:right}.MathJax .math{color:inherit}#perseus{margin:20px}#perseus #problemarea #workarea{margin:0}#perseus #problemarea #workarea .perseus-image-caption{top:0!important}#perseus .perseus-answer-container>div,#perseus .perseus-question-container>div{padding-bottom:25px}#perseus .add-choice-container,#perseus .add-hint-container{display:flex;flex-direction:row;margin-bottom:20px;text-align:left}#problemarea{float:left;font-size:14px;padding-bottom:38px;position:relative}#problemarea a:link,#problemarea input,#problemarea label,#problemarea select{position:relative;z-index:3}.perseus-editor-table{clear:both;display:table;table-layout:fixed}.perseus-editor-row{display:table-row}.perseus-editor-left-cell{display:table-cell;max-width:360px;min-width:360px;padding-right:30px;vertical-align:top;width:360px}.perseus-editor-right-cell{box-sizing:border-box;display:table-cell;padding:5px 30px 30px;vertical-align:top}.perseus-hint-editor{padding-bottom:20px}.perseus-hint-editor .perseus-single-editor{margin-bottom:5px}.perseus-hint-editor .reorder-hints button{font-size:16px}.perseus-hint-editor .reorder-hints button:active,.perseus-hint-editor .reorder-hints button:hover{color:#000;text-decoration:none}.perseus-hint-editor .reorder-hints button.hidden{visibility:hidden}.perseus-hint-editor .remove-hint{float:right;font-size:13px;padding:0 10px}.perseus-hints-editor .add-hint{font-size:13px}.perseus-hints-editor .perseus-editor-row:first-child .perseus-editor-right-cell{border-top:0}.perseus-hint-editor+div .perseus-hint-renderer{width:100%}.perseus-hint-editor+div .perseus-hint-renderer div.paragraph{margin:0 0 22px}.perseus-article-editor{margin-bottom:20px;margin-top:20px}.perseus-article-editor .perseus-editor-table{margin-left:auto;margin-right:auto}.perseus-article-editor .perseus-single-editor{margin-bottom:10px}.perseus-article-editor .section-control-button,.perseus-article-editor .step-control-button{font-size:13px;margin:0 2px;padding:2px 10px}.perseus-article-editor .perseus-editor-left-cell{min-width:360px}.perseus-article-editor .desktop-preview,.perseus-article-editor .editor-preview,.perseus-article-editor .mobile-preview,.perseus-article-editor .standalone-preview{box-sizing:border-box}.perseus-article-editor .mobile-preview{border:1px solid rgba(0,0,0,.29);box-shadow:0 2px 4px 0 rgba(0,0,0,.29);max-width:322px;padding:32px 16px}.perseus-article-editor .desktop-preview{border:1px solid transparent;padding:32px 20px}.perseus-article-editor .editor-preview{display:table-cell}.perseus-article-editor .editor-preview.full-width{width:100%}.perseus-article-editor .editor-preview .desktop-preview{border:1px solid rgba(0,0,0,.29);box-shadow:0 2px 4px 0 rgba(0,0,0,.29);width:100%}.perseus-article-editor .standalone-preview .desktop-preview,.perseus-article-editor .standalone-preview .mobile-preview{margin-left:auto;margin-right:auto}.perseus-article-editor .json-editor{margin:auto;max-width:688px}.perseus-article-editor .perseus-json-editor{display:block;margin-left:auto;margin-right:auto}.perseus-article-editor .json-editor-warning{margin-bottom:10px;text-align:center}.perseus-article-editor .framework-perseus.perseus-article{box-sizing:border-box}.perseus-article-editor .framework-perseus.perseus-article *{box-sizing:inherit}.perseus-article-editor .perseus-editor-left-cell>.pod-title{padding:4px 9px}.perseus-widget-dropdown input[type=text]{border:1px solid #ccc;border-radius:5px;padding:5px}.perseus-widget-dropdown input[type=text].correct{background:#afa}.perseus-widget-dropdown input[type=text].incorrect{background:#fcc}.perseus-widget-dropdown .dropdown-choices{margin:20px 0}.perseus-widget-dropdown .dropdown-choices input[type=text]{margin:0 5px;width:70%}.perseus-widget-dropdown .dropdown-info{display:inline-flex;margin-bottom:16px}.perseus-widget-dropdown .dropdown-field{align-items:center;display:flex;flex-direction:row;margin-bottom:16px;min-width:0}.perseus-widget-dropdown .remove-choice{margin-bottom:10px}.perseus-input-number-editor{font-family:Lato,Noto Sans,sans-serif;font-size:16px;font-weight:400;line-height:20px}.perseus-input-number-editor .answer-option .unsimplified-options{min-height:48px}.perseus-input-number-editor .perseus-textarea-pair{font-size:16px}.perseus-input-number-editor .perseus-textarea-pair .perseus-textarea-underlay{margin-bottom:26px}.perseus-input-number-editor .perseus-textarea-pair textarea{background-color:#fff;border:1px solid rgba(33,36,44,.5);border-radius:4px}.perseus-input-number-editor .input-answer-editor-message,.perseus-input-number-editor .input-answer-editor-value{display:inline-block}.perseus-input-number-editor .input-answer-editor-value-container{display:block}.perseus-input-number-editor .input-answer-editor-value-container input{background:#fff;border:1px solid rgba(33,36,44,.5);border-radius:4px;color:#21242c;font-family:Lato,Noto Sans,sans-serif;font-size:16px;font-weight:400;line-height:20px;outline-offset:-2px}.perseus-input-number-editor .input-answer-editor-value-container .numeric-input-value{margin-left:8px;width:6em}.perseus-input-number-editor .input-answer-editor-value-container .max-error-input-value{display:none;width:3em}.perseus-input-number-editor .input-answer-editor-value-container .max-error-plusmn{cursor:default;display:none;height:32px;padding-top:4px;text-align:center;vertical-align:top;width:1em}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .numeric-input-value,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .numeric-input-value{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .max-error-input-value,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .max-error-input-value{border-bottom-left-radius:0;border-left:none;border-top-left-radius:0;display:inline-block}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .max-error-plusmn,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .max-error-plusmn{border-bottom:1px solid rgba(33,36,44,.5);border-top:1px solid rgba(33,36,44,.5);display:inline-block}.perseus-input-number-editor .answer-status,.perseus-input-number-editor .answer-trash,.perseus-input-number-editor .options-toggle{height:26px;line-height:26px;outline-offset:-3px;vertical-align:middle}.perseus-input-number-editor .value-divider{border-top:1px solid #ccc}.perseus-input-number-editor .answer-trash,.perseus-input-number-editor .options-toggle{border-left:1px solid #ccc;box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;text-decoration:none;width:20%}.perseus-input-number-editor .options-toggle{background-color:#eee;color:#444}.perseus-input-number-editor .options-toggle:hover{background-color:#ccc}.perseus-input-number-editor .answer-trash{background-color:#c04f03;background-image:linear-gradient(180deg,#e35d04,#c04f03);color:#fff}.perseus-input-number-editor .answer-trash:hover{background-image:linear-gradient(180deg,#f46e15,#d16014);color:#fff}.perseus-input-number-editor .is-strict-indicator{background-color:#d9edf7;border-bottom:1px solid #ccc;font-size:16px;height:12px;line-height:12px;top:0}.perseus-input-number-editor .is-strict-indicator,.perseus-input-number-editor .simplify-indicator{border-right:1px solid #ccc;bottom:auto;cursor:default;left:0;position:absolute;right:auto;text-align:center;-webkit-user-select:none;user-select:none;width:12px}.perseus-input-number-editor .simplify-indicator{border-top:1px solid #ccc;font-size:10px;height:13px;line-height:13px;top:12px}.perseus-input-number-editor .simplify-indicator.optional{background-color:#afa}.perseus-input-number-editor .simplify-indicator.enforced{background-color:#fcc}.perseus-input-number-editor .answer-status{color:inherit;display:inline-block;text-align:center;text-decoration:none;-webkit-user-select:none;user-select:none;width:60%}.perseus-input-number-editor .answer-status.wrong{background-color:#fcc}.perseus-input-number-editor .answer-status.correct{background-color:#afa}.perseus-input-number-editor .answer-status.ungraded{background-color:#d9edf7}.perseus-input-number-editor .input-answer-editor-message{margin-left:5px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor{font-family:Lucida Grande;width:230px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-pair>textarea,.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-underlay{padding:5px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-pair{border-color:#ccc;border-radius:3px;min-height:53px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-underlay{margin-bottom:0}.perseus-widget-radio{margin-bottom:10px}.perseus-widget-radio .choice-editor .perseus-single-editor{margin-bottom:0}.perseus-widget-radio .choice-editor.correct textarea{background:#afa}.perseus-widget-radio .choice-editor.incorrect textarea{background:#fcc}.perseus-widget-radio textarea::placeholder{color:#777}.perseus-widget-radio .clue-editor .perseus-textarea-pair{border-top:0}.perseus-widget-radio .choice-clue-editors,.perseus-widget-radio .choice-editor,.perseus-widget-radio .clue-editor{display:inline-block;width:100%}.perseus-widget-radio .perseus-single-editor{border:0;display:inline-block;margin:0 0 5px;vertical-align:top}.perseus-widget-radio .perseus-single-editor p{margin:0}.perseus-widget-radio .perseus-textarea-pair,.perseus-widget-radio .perseus-textarea-underlay{display:block;overflow-wrap:anywhere}.perseus-widget-radio .perseus-textarea-pair>.perseus-textarea-underlay,.perseus-widget-radio .perseus-textarea-pair>textarea{padding:5px}.perseus-widget-editor-content .add-choice-container .simple-button{margin-right:10px}.perseus-widget-editor-content .perseus-widget-radio{position:static}.perseus-widget-editor-content .perseus-widget-radio .checkbox{position:relative;top:-10px}.perseus-widget-editor-content .perseus-radio-option.none-of-above:before{content:"None of the above";display:block;font-style:italic;font-weight:700}.perseus-widget-editor-content .perseus-radio-option.none-of-above .choice-editor.incorrect{opacity:.5}#solutionarea .perseus-widget-radio li{padding:7px 0}.framework-perseus table.perseus-widget-table-of-values th .perseus-single-editor{margin-bottom:6px;width:80px}.framework-perseus table.perseus-widget-table-of-values th .perseus-single-editor,.framework-perseus table.perseus-widget-table-of-values th .perseus-textarea-pair{height:50px}.categorization-container.categorization-container-editor{margin-bottom:160px;width:350px}.categorization-container.categorization-container-editor .card input{display:block;font-size:12px;margin:7px 3px 7px 13px;width:81%}.categorization-container.categorization-container-editor .category{float:left;padding:5px;width:160px}.categorization-container.categorization-container-editor .categories{width:176px}.categorization-container.categorization-container-editor .perseus-textarea-underlay{margin-bottom:0}.categorization-container.categorization-container-editor .drag-bar{float:left;font-size:10px;height:70%;margin-top:3px;padding:2px 0}.categorization-container.categorization-container-editor .header{margin-bottom:8px}.categorization-container.categorization-container-editor .header input{display:block;margin-right:24px;width:76%}.categorization-container.categorization-container-editor .header .remove{color:#666;cursor:pointer;float:right;height:20px;left:12px;padding:2px;position:relative;top:-14px;width:20px}.categorization-container.categorization-container-editor .header .remove:hover{color:#333}.categorization-container.categorization-container-editor .delete-item-area{border:2px dashed #888;bottom:-150px;color:#888;font-size:20px;height:60px;left:10px;padding-top:40px;position:absolute;text-align:center;width:150px}.categorization-container.categorization-container-editor .delete-item-area.target{border-color:#000;color:#333}.categorization-container.categorization-container-editor .card{padding:0;width:130px}.categorization-container.categorization-container-editor .card.dragging .drag-bar{margin-left:2px}.categorization-editor-area{height:30px}.categorization-editor-area .add-item{float:left;margin-left:17px}.categorization-editor-area .add-category{margin-left:173px}.perseus-widget-interactive-graph{display:block}.perseus-widget-plotter-editor .pic-url,.perseus-widget-plotter-editor .plotter-categories{width:70%}.perseus-text-list-editor input[type=text]{margin-right:5px;max-width:340px;min-width:20px;padding:3px}.perseus-text-list-editor.layout-horizontal input[type=text]{float:left}.perseus-matcher-editor .perseus-text-list-editor{float:left;max-width:50%}.perseus-matcher-editor .perseus-text-list-editor input[type=text]{max-width:90%}.perseus-matcher-editor input[type=text]{width:46%}.perseus-matcher-editor input[type=text]+input[type=text]{margin-left:2%}.info-tip{display:inline-block}.info-tip-content-container p{font-size:12px;line-height:1.4;margin:0}.info-tip-content-container p+p{margin-top:22px}.perseus-widget-interaction-editor .perseus-widget-interaction-editor-select-element{background-color:#eee;border:1px solid #ddd;border-radius:0 0 3px 3px;border-top:0;margin:20px -11px -11px;padding:5px 10px}.perseus-widget-interaction-editor .colorpicker-circle{border-radius:50%;height:14px;left:5px;position:absolute;top:5px;width:14px}.perseus-interaction-element{border:1px solid #ddd;border-radius:3px}.perseus-interaction-element .perseus-interaction-element-title{background-color:#eee;border:0;border-radius:3px 3px 0 0;color:inherit;display:block;font-size:1.25em;font-size:1em;overflow:hidden;padding:4px 10px;text-decoration:none;white-space:nowrap}.perseus-interaction-element .perseus-interaction-element-title.closed{border-radius:3px}.perseus-interaction-element .perseus-interaction-element-title>svg{float:left;font-size:14px;margin-right:10px}.perseus-interaction-element .perseus-interaction-element-content{border-radius:0 0 3px 3px;border-top:1px solid #ddd;padding:10px}.perseus-interaction-element .perseus-interaction-element-content .edit-controls{margin-top:-30px;text-align:right}.perseus-interaction-element .perseus-interaction-element-content .edit-controls>button{background:#fff;border:0;color:#555;cursor:pointer;font-size:18px;margin-left:7px;padding:0}.perseus-interaction-element .perseus-interaction-element-content.leave{display:none}.button-set-separator{margin:10px 0}.perseus-widget-editor .unit-radio{color:#000;text-decoration:none}.unit-example-not-okay{color:red}.unit-example-okay{color:green}.pair-editor input{width:120px}.marvel-device.iphone6.silver:after{z-index:1}.perseus-diff{margin:0 10px}.perseus-diff .diff-header{display:inline-block;font-size:18px;padding:10px 0;width:50%}.perseus-diff .diff-header.collapsed{font-size:14px;padding:0}.perseus-diff .diff-body{border-bottom:1px solid #e4e4e4;border-top:1px solid #e4e4e4}.perseus-diff .diff-row{box-sizing:border-box;font-size:14px;overflow:hidden;padding-left:10px;padding-right:20px;white-space:pre-wrap;width:50%}.perseus-diff .diff-row.collapsed{color:#888;cursor:pointer}.perseus-diff .diff-row.collapsed:hover{color:#666}.perseus-diff .diff-row.collapsed:active{color:#444}.perseus-diff .diff-row .diff-line{margin-bottom:20px}.perseus-diff .before{border-left:1px solid #e4e4e4;float:left}.perseus-diff .after{border-left:1px solid #e4e4e4;border-right:1px solid #e4e4e4;float:right}.perseus-diff .inner-value{height:100%;padding:3px}.perseus-diff .not-present{display:none}.perseus-diff .blank-space{visibility:hidden}.perseus-diff .added{background-color:#efe}.perseus-diff .added.dark{background-color:#afa}.perseus-diff .removed{background-color:#fee}.perseus-diff .removed.dark{background-color:#faa}.perseus-diff .image{display:inline-block;margin-bottom:10px;margin-left:20px}.perseus-diff .image,.perseus-diff .image>div,.perseus-diff .image>img{max-height:300px;max-width:100%}.perseus-diff .image-unchanged{border:1px solid #aaa}.perseus-diff .image-added{border:2px solid #afa}.perseus-diff .image-removed{border:2px solid #faa}.perseus-diff .diff-separator{border-bottom:1px dashed #444;margin:30px 0 10px}
|
|
1
|
+
code{font-family:Courier,monospace}.pod-title{background-color:#eee;border:1px solid #ddd;border-bottom:0;border-radius:3px 3px 0 0;font-size:1.25em;padding:4px 10px}.pod-title.closed{border-radius:3px}.smiley{left:0;position:absolute;top:4px}.perseus-single-editor{box-sizing:border-box;width:100%}.perseus-json-editor{font-family:monospace;height:500px;width:100%}.perseus-json-editor.invalid{background-color:#ffe6e6}.perseus-textarea-pair{border:1px solid #ddd;font-size:12px;line-height:1.6;position:relative}.perseus-textarea-pair>.perseus-textarea-underlay{word-wrap:break-word;color:transparent;margin-bottom:12px;padding:10px;white-space:pre-wrap}.perseus-textarea-pair>.perseus-textarea-underlay b{background-color:#dfd;font-weight:400}.perseus-textarea-pair>.perseus-textarea-underlay b.selected{background-color:#ddf}.perseus-textarea-pair>.perseus-textarea-underlay b.error{background-color:#fcc}.perseus-textarea-pair>textarea{background:transparent;border:0;box-sizing:border-box;font:inherit;height:100%;left:0;overflow:hidden;padding:10px;position:absolute;resize:none;top:0;width:100%}.perseus-widget-row{margin:7px 0;width:100%}.perseus-widget-row .perseus-widget-left-col,.perseus-widget-row .perseus-widget-right-col{display:inline-block;width:50%}.perseus-widget-row .perseus-widget-left-col .range-input,.perseus-widget-row .perseus-widget-right-col .range-input{float:right;margin-right:5px}.perseus-widget-row>.range-input{margin-left:10px}.perseus-answer-options{border:1px solid #ddd;padding:10px}.perseus-answer-options *{margin-bottom:4px}.perseus-answer-widget{border:1px solid #ddd;border-radius:0 0 3px 3px;padding:10px}.perseus-answer-none{border-bottom:1px solid #ddd}.perseus-answer-none>div{display:none}.perseus-widget-editor{border:1px solid #ddd;border-radius:3px;margin-top:10px}.perseus-widget-editor .perseus-widget-editor-title{align-items:center;background-color:#eee;border:0;border-radius:3px 3px 0 0;cursor:pointer;display:flex;font-size:1.25em;padding:4px 10px;position:relative}.perseus-widget-editor .perseus-widget-editor-title.closed{border-radius:3px}.perseus-widget-editor .perseus-widget-editor-title :first-child{flex-grow:1}.perseus-widget-editor .perseus-widget-editor-title>a{color:inherit;text-decoration:none}.perseus-widget-editor .perseus-widget-editor-title .alignment{margin-right:5px}.perseus-widget-editor .perseus-widget-editor-title .simple-button{font-size:13px;padding:0 10px}.perseus-widget-editor .perseus-widget-editor-content{border-radius:0 0 3px 3px;border-top:1px solid #ddd;padding:10px;transition:all 0s}.perseus-widget-editor .perseus-widget-editor-content.leave{display:none}.perseus-widget-editor .perseus-widget-editor-content .inline-options{float:inline-start;line-height:24px;padding-inline-end:.5em}.perseus-widget-editor .perseus-widget-editor-content .tooltip-for-legend{display:inline-block;line-height:24px}.perseus-widget-editor .categorizer-container{overflow-x:scroll}.perseus-widget-editor .section-accordion{display:flex;flex-direction:row}.perseus-widget-editor .delete-item-button{align-self:center;padding-right:.5em}.perseus-widget-editor-title-id{align-items:center;display:inline-flex}.perseus-widget-editor-title-id>svg{float:left;font-size:14px;margin-right:10px}.perseus-editor-accordion-container{display:inline-grid;width:100%}.perseus-editor-accordion-container.collapsed{grid-template-rows:0fr;min-height:0;transition:all .25s step-end,grid-template-rows .25s;visibility:hidden}.perseus-editor-accordion-container.expanded{grid-template-rows:1fr;min-height:100%;transition:grid-template-rows .5s;visibility:visible}.perseus-editor-accordion-container .perseus-editor-accordion-content{margin:0 -1px;overflow:hidden;padding:0 1px}.perseus-editor-widgets-selectors{background-color:#eee;border:1px solid #ddd;border-radius:0 0 3px 3px;border-top:0;display:flex;flex-wrap:wrap;padding:10px/2}.perseus-editor-widgets-selectors select{margin:2px}.perseus-editor-widgets>div.selected>strong{background-color:#ddf}.perseus-editor-widgets .warning{background-color:#fcc;margin:4px;padding:4px}.perseus-editor-word-count{cursor:help;flex:1;float:right;margin-right:3px;margin-top:2px;text-align:right}.MathJax .math{color:inherit}#perseus{margin:20px}#perseus #problemarea #workarea{margin:0}#perseus #problemarea #workarea .perseus-image-caption{top:0!important}#perseus .perseus-answer-container>div,#perseus .perseus-question-container>div{padding-bottom:25px}#perseus .add-choice-container,#perseus .add-hint-container{display:flex;flex-direction:row;margin-bottom:20px;text-align:left}#problemarea{float:left;font-size:14px;padding-bottom:38px;position:relative}#problemarea a:link,#problemarea input,#problemarea label,#problemarea select{position:relative;z-index:3}.perseus-editor-table{clear:both;display:table;table-layout:fixed}.perseus-editor-row{display:table-row}.perseus-editor-left-cell{display:table-cell;max-width:360px;min-width:360px;padding-right:30px;vertical-align:top;width:360px}.perseus-editor-right-cell{box-sizing:border-box;display:table-cell;padding:5px 30px 30px;vertical-align:top}.perseus-hint-editor{padding-bottom:20px}.perseus-hint-editor .perseus-single-editor{margin-bottom:5px}.perseus-hint-editor .reorder-hints button{font-size:16px}.perseus-hint-editor .reorder-hints button:active,.perseus-hint-editor .reorder-hints button:hover{color:#000;text-decoration:none}.perseus-hint-editor .reorder-hints button.hidden{visibility:hidden}.perseus-hint-editor .remove-hint{float:right;font-size:13px;padding:0 10px}.perseus-hints-editor .add-hint{font-size:13px}.perseus-hints-editor .perseus-editor-row:first-child .perseus-editor-right-cell{border-top:0}.perseus-hint-editor+div .perseus-hint-renderer{width:100%}.perseus-hint-editor+div .perseus-hint-renderer div.paragraph{margin:0 0 22px}.perseus-article-editor{margin-bottom:20px;margin-top:20px}.perseus-article-editor .perseus-editor-table{margin-left:auto;margin-right:auto}.perseus-article-editor .perseus-single-editor{margin-bottom:10px}.perseus-article-editor .section-control-button,.perseus-article-editor .step-control-button{font-size:13px;margin:0 2px;padding:2px 10px}.perseus-article-editor .perseus-editor-left-cell{min-width:360px}.perseus-article-editor .desktop-preview,.perseus-article-editor .editor-preview,.perseus-article-editor .mobile-preview,.perseus-article-editor .standalone-preview{box-sizing:border-box}.perseus-article-editor .mobile-preview{border:1px solid rgba(0,0,0,.29);box-shadow:0 2px 4px 0 rgba(0,0,0,.29);max-width:322px;padding:32px 16px}.perseus-article-editor .desktop-preview{border:1px solid transparent;padding:32px 20px}.perseus-article-editor .editor-preview{display:table-cell}.perseus-article-editor .editor-preview.full-width{width:100%}.perseus-article-editor .editor-preview .desktop-preview{border:1px solid rgba(0,0,0,.29);box-shadow:0 2px 4px 0 rgba(0,0,0,.29);width:100%}.perseus-article-editor .standalone-preview .desktop-preview,.perseus-article-editor .standalone-preview .mobile-preview{margin-left:auto;margin-right:auto}.perseus-article-editor .json-editor{margin:auto;max-width:688px}.perseus-article-editor .perseus-json-editor{display:block;margin-left:auto;margin-right:auto}.perseus-article-editor .json-editor-warning{margin-bottom:10px;text-align:center}.perseus-article-editor .framework-perseus.perseus-article{box-sizing:border-box}.perseus-article-editor .framework-perseus.perseus-article *{box-sizing:inherit}.perseus-article-editor .perseus-editor-left-cell>.pod-title{padding:4px 9px}.perseus-widget-dropdown input[type=text]{border:1px solid #ccc;border-radius:5px;padding:5px}.perseus-widget-dropdown input[type=text].correct{background:#afa}.perseus-widget-dropdown input[type=text].incorrect{background:#fcc}.perseus-widget-dropdown .dropdown-choices{margin:20px 0}.perseus-widget-dropdown .dropdown-choices input[type=text]{margin:0 5px;width:70%}.perseus-widget-dropdown .dropdown-info{display:inline-flex;margin-bottom:16px}.perseus-widget-dropdown .dropdown-field{align-items:center;display:flex;flex-direction:row;margin-bottom:16px;min-width:0}.perseus-widget-dropdown .remove-choice{margin-bottom:10px}.perseus-input-number-editor{font-family:Lato,Noto Sans,sans-serif;font-size:16px;font-weight:400;line-height:20px}.perseus-input-number-editor .answer-option .unsimplified-options{min-height:48px}.perseus-input-number-editor .perseus-textarea-pair{font-size:16px}.perseus-input-number-editor .perseus-textarea-pair .perseus-textarea-underlay{margin-bottom:26px}.perseus-input-number-editor .perseus-textarea-pair textarea{background-color:#fff;border:1px solid rgba(33,36,44,.5);border-radius:4px}.perseus-input-number-editor .input-answer-editor-message,.perseus-input-number-editor .input-answer-editor-value{display:inline-block}.perseus-input-number-editor .input-answer-editor-value-container{display:block}.perseus-input-number-editor .input-answer-editor-value-container input{background:#fff;border:1px solid rgba(33,36,44,.5);border-radius:4px;color:#21242c;font-family:Lato,Noto Sans,sans-serif;font-size:16px;font-weight:400;line-height:20px;outline-offset:-2px}.perseus-input-number-editor .input-answer-editor-value-container .numeric-input-value{margin-left:8px;width:6em}.perseus-input-number-editor .input-answer-editor-value-container .max-error-input-value{display:none;width:3em}.perseus-input-number-editor .input-answer-editor-value-container .max-error-plusmn{cursor:default;display:none;height:32px;padding-top:4px;text-align:center;vertical-align:top;width:1em}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .numeric-input-value,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .numeric-input-value{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .max-error-input-value,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .max-error-input-value{border-bottom-left-radius:0;border-left:none;border-top-left-radius:0;display:inline-block}.perseus-input-number-editor .input-answer-editor-value-container.with-max-error .max-error-plusmn,.perseus-input-number-editor .input-answer-editor-value-container:focus-within .max-error-plusmn{border-bottom:1px solid rgba(33,36,44,.5);border-top:1px solid rgba(33,36,44,.5);display:inline-block}.perseus-input-number-editor .answer-status,.perseus-input-number-editor .answer-trash,.perseus-input-number-editor .options-toggle{height:26px;line-height:26px;outline-offset:-3px;vertical-align:middle}.perseus-input-number-editor .value-divider{border-top:1px solid #ccc}.perseus-input-number-editor .answer-trash,.perseus-input-number-editor .options-toggle{border-left:1px solid #ccc;box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;text-decoration:none;width:20%}.perseus-input-number-editor .options-toggle{background-color:#eee;color:#444}.perseus-input-number-editor .options-toggle:hover{background-color:#ccc}.perseus-input-number-editor .answer-trash{background-color:#c04f03;background-image:linear-gradient(180deg,#e35d04,#c04f03);color:#fff}.perseus-input-number-editor .answer-trash:hover{background-image:linear-gradient(180deg,#f46e15,#d16014);color:#fff}.perseus-input-number-editor .is-strict-indicator{background-color:#d9edf7;border-bottom:1px solid #ccc;font-size:16px;height:12px;line-height:12px;top:0}.perseus-input-number-editor .is-strict-indicator,.perseus-input-number-editor .simplify-indicator{border-right:1px solid #ccc;bottom:auto;cursor:default;left:0;position:absolute;right:auto;text-align:center;-webkit-user-select:none;user-select:none;width:12px}.perseus-input-number-editor .simplify-indicator{border-top:1px solid #ccc;font-size:10px;height:13px;line-height:13px;top:12px}.perseus-input-number-editor .simplify-indicator.optional{background-color:#afa}.perseus-input-number-editor .simplify-indicator.enforced{background-color:#fcc}.perseus-input-number-editor .answer-status{color:inherit;display:inline-block;text-align:center;text-decoration:none;-webkit-user-select:none;user-select:none;width:60%}.perseus-input-number-editor .answer-status.wrong{background-color:#fcc}.perseus-input-number-editor .answer-status.correct{background-color:#afa}.perseus-input-number-editor .answer-status.ungraded{background-color:#d9edf7}.perseus-input-number-editor .input-answer-editor-message{margin-left:5px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor{font-family:Lucida Grande;width:230px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-pair>textarea,.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-underlay{padding:5px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-pair{border-color:#ccc;border-radius:3px;min-height:53px}.perseus-input-number-editor .input-answer-editor-message .perseus-single-editor .perseus-textarea-underlay{margin-bottom:0}.perseus-widget-radio{margin-bottom:10px}.perseus-widget-radio .choice-editor .perseus-single-editor{margin-bottom:0}.perseus-widget-radio .choice-editor.correct textarea{background:#afa}.perseus-widget-radio .choice-editor.incorrect textarea{background:#fcc}.perseus-widget-radio textarea::placeholder{color:#777}.perseus-widget-radio .rationale-editor .perseus-textarea-pair{border-top:0}.perseus-widget-radio .choice-editor,.perseus-widget-radio .choice-rationale-editors,.perseus-widget-radio .rationale-editor{display:inline-block;width:100%}.perseus-widget-radio .perseus-single-editor{border:0;display:inline-block;margin:0 0 5px;vertical-align:top}.perseus-widget-radio .perseus-single-editor p{margin:0}.perseus-widget-radio .perseus-textarea-pair,.perseus-widget-radio .perseus-textarea-underlay{display:block;overflow-wrap:anywhere}.perseus-widget-radio .perseus-textarea-pair>.perseus-textarea-underlay,.perseus-widget-radio .perseus-textarea-pair>textarea{padding:5px}.perseus-widget-editor-content .add-choice-container .simple-button{margin-right:10px}.perseus-widget-editor-content .perseus-widget-radio{position:static}.perseus-widget-editor-content .perseus-widget-radio .checkbox{position:relative;top:-10px}.perseus-widget-editor-content .perseus-radio-option.none-of-above:before{content:"None of the above";display:block;font-style:italic;font-weight:700}.perseus-widget-editor-content .perseus-radio-option.none-of-above .choice-editor.incorrect{opacity:.5}#solutionarea .perseus-widget-radio li{padding:7px 0}.framework-perseus table.perseus-widget-table-of-values th .perseus-single-editor{margin-bottom:6px;width:80px}.framework-perseus table.perseus-widget-table-of-values th .perseus-single-editor,.framework-perseus table.perseus-widget-table-of-values th .perseus-textarea-pair{height:50px}.categorization-container.categorization-container-editor{margin-bottom:160px;width:350px}.categorization-container.categorization-container-editor .card input{display:block;font-size:12px;margin:7px 3px 7px 13px;width:81%}.categorization-container.categorization-container-editor .category{float:left;padding:5px;width:160px}.categorization-container.categorization-container-editor .categories{width:176px}.categorization-container.categorization-container-editor .perseus-textarea-underlay{margin-bottom:0}.categorization-container.categorization-container-editor .drag-bar{float:left;font-size:10px;height:70%;margin-top:3px;padding:2px 0}.categorization-container.categorization-container-editor .header{margin-bottom:8px}.categorization-container.categorization-container-editor .header input{display:block;margin-right:24px;width:76%}.categorization-container.categorization-container-editor .header .remove{color:#666;cursor:pointer;float:right;height:20px;left:12px;padding:2px;position:relative;top:-14px;width:20px}.categorization-container.categorization-container-editor .header .remove:hover{color:#333}.categorization-container.categorization-container-editor .delete-item-area{border:2px dashed #888;bottom:-150px;color:#888;font-size:20px;height:60px;left:10px;padding-top:40px;position:absolute;text-align:center;width:150px}.categorization-container.categorization-container-editor .delete-item-area.target{border-color:#000;color:#333}.categorization-container.categorization-container-editor .card{padding:0;width:130px}.categorization-container.categorization-container-editor .card.dragging .drag-bar{margin-left:2px}.categorization-editor-area{height:30px}.categorization-editor-area .add-item{float:left;margin-left:17px}.categorization-editor-area .add-category{margin-left:173px}.perseus-widget-interactive-graph{display:block}.perseus-widget-plotter-editor .pic-url,.perseus-widget-plotter-editor .plotter-categories{width:70%}.perseus-text-list-editor input[type=text]{margin-right:5px;max-width:340px;min-width:20px;padding:3px}.perseus-text-list-editor.layout-horizontal input[type=text]{float:left}.perseus-matcher-editor .perseus-text-list-editor{float:left;max-width:50%}.perseus-matcher-editor .perseus-text-list-editor input[type=text]{max-width:90%}.perseus-matcher-editor input[type=text]{width:46%}.perseus-matcher-editor input[type=text]+input[type=text]{margin-left:2%}.info-tip{display:inline-block}.info-tip-content-container p{font-size:12px;line-height:1.4;margin:0}.info-tip-content-container p+p{margin-top:22px}.perseus-widget-interaction-editor .perseus-widget-interaction-editor-select-element{background-color:#eee;border:1px solid #ddd;border-radius:0 0 3px 3px;border-top:0;margin:20px -11px -11px;padding:5px 10px}.perseus-widget-interaction-editor .colorpicker-circle{border-radius:50%;height:14px;left:5px;position:absolute;top:5px;width:14px}.perseus-interaction-element{border:1px solid #ddd;border-radius:3px}.perseus-interaction-element .perseus-interaction-element-title{background-color:#eee;border:0;border-radius:3px 3px 0 0;color:inherit;display:block;font-size:1.25em;font-size:1em;overflow:hidden;padding:4px 10px;text-decoration:none;white-space:nowrap}.perseus-interaction-element .perseus-interaction-element-title.closed{border-radius:3px}.perseus-interaction-element .perseus-interaction-element-title>svg{float:left;font-size:14px;margin-right:10px}.perseus-interaction-element .perseus-interaction-element-content{border-radius:0 0 3px 3px;border-top:1px solid #ddd;padding:10px}.perseus-interaction-element .perseus-interaction-element-content .edit-controls{margin-top:-30px;text-align:right}.perseus-interaction-element .perseus-interaction-element-content .edit-controls>button{background:#fff;border:0;color:#555;cursor:pointer;font-size:18px;margin-left:7px;padding:0}.perseus-interaction-element .perseus-interaction-element-content.leave{display:none}.button-set-separator{margin:10px 0}.perseus-widget-editor .unit-radio{color:#000;text-decoration:none}.unit-example-not-okay{color:red}.unit-example-okay{color:green}.pair-editor input{width:120px}.marvel-device.iphone6.silver:after{z-index:1}.perseus-diff{margin:0 10px}.perseus-diff .diff-header{display:inline-block;font-size:18px;padding:10px 0;width:50%}.perseus-diff .diff-header.collapsed{font-size:14px;padding:0}.perseus-diff .diff-body{border-bottom:1px solid #e4e4e4;border-top:1px solid #e4e4e4}.perseus-diff .diff-row{box-sizing:border-box;font-size:14px;overflow:hidden;padding-left:10px;padding-right:20px;white-space:pre-wrap;width:50%}.perseus-diff .diff-row.collapsed{color:#888;cursor:pointer}.perseus-diff .diff-row.collapsed:hover{color:#666}.perseus-diff .diff-row.collapsed:active{color:#444}.perseus-diff .diff-row .diff-line{margin-bottom:20px}.perseus-diff .before{border-left:1px solid #e4e4e4;float:left}.perseus-diff .after{border-left:1px solid #e4e4e4;border-right:1px solid #e4e4e4;float:right}.perseus-diff .inner-value{height:100%;padding:3px}.perseus-diff .not-present{display:none}.perseus-diff .blank-space{visibility:hidden}.perseus-diff .added{background-color:#efe}.perseus-diff .added.dark{background-color:#afa}.perseus-diff .removed{background-color:#fee}.perseus-diff .removed.dark{background-color:#faa}.perseus-diff .image{display:inline-block;margin-bottom:10px;margin-left:20px}.perseus-diff .image,.perseus-diff .image>div,.perseus-diff .image>img{max-height:300px;max-width:100%}.perseus-diff .image-unchanged{border:1px solid #aaa}.perseus-diff .image-added{border:2px solid #afa}.perseus-diff .image-removed{border:2px solid #faa}.perseus-diff .diff-separator{border-bottom:1px dashed #444;margin:30px 0 10px}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/es/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["perseus-editor.css"],"names":[],"mappings":"AAAA,KACI,6BACJ,CACA,WACI,qBAAsB,CACtB,qBAAsB,CACtB,eAAgB,CAGhB,yBAA0B,CAF1B,gBAAiB,CACjB,gBAEJ,CACA,kBACI,iBACJ,CACA,QAEI,MAAS,CADT,iBAAkB,CAElB,OACJ,CACA,uBACI,qBAAsB,CACtB,UACJ,CACA,qBAEI,qBAAsB,CACtB,YAAa,CAFb,UAGJ,CACA,6BACI,wBACJ,CACA,uBACI,qBAAsB,CACtB,cAAe,CACf,eAAgB,CAChB,iBACJ,CACA,kDAKI,oBAAqB,CAJrB,iBAAkB,CAClB,kBAAmB,CACnB,YAAa,CACb,oBAEJ,CACA,oDAEI,qBAAsB,CADtB,eAEJ,CACA,6DACI,qBACJ,CACA,0DACI,qBACJ,CACA,gCACI,sBAAuB,CACvB,QAAS,CACT,qBAAsB,CACtB,YAAa,CACb,WAAY,CACZ,MAAO,CACP,eAAgB,CAChB,YAAa,CACb,iBAAkB,CAClB,WAAY,CAC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W,CACX,cAAe,CACf,iBACJ,CACA,kEACI,yBAA0B,CAC1B,yBAA0B,CAC1B,YACJ,CACA,iFAII,gBAAiB,CADjB,gBAEJ,CACA,wFAII,eAAgB,CAChB,QAAS,CAKT,UAAW,CAJX,cAAe,CAGf,cAAe,CADf,eAAgB,CADhB,SAIJ,CACA,wEACI,YACJ,CACA,sBACI,aACJ,CACA,mCACI,UAAY,CACZ,oBACJ,CACA,uBACI,SACJ,CACA,mBACI,WACJ,CACA,mBACI,WACJ,CACA,oCACI,SACJ,CACA,cACI,aACJ,CACA,2BAII,oBAAqB,CAHrB,cAAe,CACf,cAAe,CACf,SAEJ,CACA,qCACI,cAAe,CACf,SACJ,CACA,yBAEI,+BAAgC,CADhC,4BAEJ,CACA,wBAGI,qBAAsB,CACtB,cAAe,CAGf,eAAgB,CADhB,iBAAkB,CADlB,kBAAmB,CAHnB,oBAAqB,CADrB,SAOJ,CACA,kCACI,UAAW,CACX,cACJ,CACA,wCACI,UACJ,CACA,yCACI,UACJ,CACA,mCACI,kBACJ,CACA,sBAEI,6BAA8B,CAD9B,UAEJ,CACA,qBAGI,6BAA8B,CAD9B,8BAA+B,CAD/B,WAGJ,CACA,2BACI,WAAY,CACZ,WACJ,CACA,2BACI,YACJ,CACA,2BACI,iBACJ,CACA,qBACI,qBACJ,CACA,0BACI,qBACJ,CACA,uBACI,qBACJ,CACA,4BACI,qBACJ,CACA,qBACI,oBAAqB,CAErB,kBAAmB,CADnB,gBAEJ,CACA,uEAGI,gBAAiB,CACjB,cACJ,CACA,+BACI,qBACJ,CACA,2BACI,qBACJ,CACA,6BACI,qBACJ,CACA,8BACI,6BAA8B,CAC9B,kBACJ","file":"index.css","sourcesContent":["code {\n font-family: Courier, monospace;\n}\n.pod-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n}\n.pod-title.closed {\n border-radius: 3px;\n}\n.smiley {\n position: absolute;\n left: 0px;\n top: 4px;\n}\n.perseus-single-editor {\n box-sizing: border-box;\n width: 100%;\n}\n.perseus-json-editor {\n width: 100%;\n font-family: monospace;\n height: 500px;\n}\n.perseus-json-editor.invalid {\n background-color: #ffe6e6;\n}\n.perseus-textarea-pair {\n border: 1px solid #ddd;\n font-size: 12px;\n line-height: 1.6;\n position: relative;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay {\n color: transparent;\n margin-bottom: 12px;\n padding: 10px;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b {\n font-weight: normal;\n background-color: #dfd;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b.selected {\n background-color: #ddf;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b.error {\n background-color: #fcc;\n}\n.perseus-textarea-pair > textarea {\n background: transparent;\n border: 0;\n box-sizing: border-box;\n font: inherit;\n height: 100%;\n left: 0;\n overflow: hidden;\n padding: 10px;\n position: absolute;\n resize: none;\n top: 0;\n width: 100%;\n}\n.perseus-widget-row {\n margin: 7px 0;\n width: 100%;\n}\n.perseus-widget-row .perseus-widget-left-col,\n.perseus-widget-row .perseus-widget-right-col {\n display: inline-block;\n width: 50%;\n}\n.perseus-widget-row .perseus-widget-left-col .range-input,\n.perseus-widget-row .perseus-widget-right-col .range-input {\n float: right;\n margin-right: 5px;\n}\n.perseus-widget-row > .range-input {\n margin-left: 10px;\n}\n.perseus-answer-options {\n border: 1px solid #ddd;\n padding: 10px;\n}\n.perseus-answer-options * {\n margin-bottom: 4px;\n}\n.perseus-answer-widget {\n border: 1px solid #ddd;\n border-radius: 0 0 3px 3px;\n padding: 10px;\n}\n.perseus-answer-none {\n border-bottom: 1px solid #ddd;\n}\n.perseus-answer-none > div {\n display: none;\n}\n.perseus-widget-editor {\n border: 1px solid #ddd;\n border-radius: 3px;\n margin-top: 10px;\n}\n.perseus-widget-editor .perseus-widget-editor-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n border: 0;\n display: flex;\n align-items: center;\n position: relative;\n cursor: pointer;\n}\n.perseus-widget-editor .perseus-widget-editor-title.closed {\n border-radius: 3px;\n}\n.perseus-widget-editor .perseus-widget-editor-title :first-child {\n flex-grow: 1;\n}\n.perseus-widget-editor .perseus-widget-editor-title > a {\n color: inherit;\n text-decoration: none;\n}\n.perseus-widget-editor .perseus-widget-editor-title .alignment {\n margin-right: 5px;\n}\n.perseus-widget-editor .perseus-widget-editor-title .simple-button {\n font-size: 13px;\n padding: 0 10px;\n}\n.perseus-widget-editor .perseus-widget-editor-content {\n border-radius: 0 0 3px 3px;\n border-top: 1px solid #ddd;\n padding: 10px;\n transition: all 0s;\n}\n.perseus-widget-editor .perseus-widget-editor-content.leave {\n display: none;\n}\n.perseus-widget-editor .perseus-widget-editor-content .inline-options {\n float: inline-start;\n /* flexbox and inline-block don't work on <legend> elements, so going old-school here */\n line-height: 24px;\n /* for alignment with items in same line (like pills or buttons) */\n padding-inline-end: 0.5em;\n}\n.perseus-widget-editor .perseus-widget-editor-content .tooltip-for-legend {\n display: inline-block;\n line-height: 24px;\n}\n.perseus-widget-editor .categorizer-container {\n overflow-x: scroll;\n}\n.perseus-widget-editor .section-accordion {\n display: flex;\n flex-direction: row;\n}\n.perseus-widget-editor .delete-item-button {\n align-self: center;\n padding-right: 0.5em;\n}\n.perseus-widget-editor-title-id {\n display: inline-flex;\n align-items: center;\n}\n.perseus-widget-editor-title-id > svg {\n float: left;\n font-size: 14px;\n margin-right: 10px;\n}\n.perseus-editor-accordion-container {\n display: inline-grid;\n width: 100%;\n}\n.perseus-editor-accordion-container.collapsed {\n grid-template-rows: 0fr;\n min-height: 0;\n visibility: hidden;\n transition:\n all 0.25s step-end,\n grid-template-rows 0.25s;\n}\n.perseus-editor-accordion-container.expanded {\n grid-template-rows: 1fr;\n min-height: 100%;\n visibility: visible;\n transition: grid-template-rows 0.5s;\n}\n.perseus-editor-accordion-container .perseus-editor-accordion-content {\n overflow: hidden;\n margin: 0 -1px;\n /* allows focus ring on accordion to show */\n padding: 0 1px;\n}\n.perseus-editor-widgets-selectors {\n background-color: #eee;\n border: 1px solid #ddd;\n border-top: 0;\n border-radius: 0 0 3px 3px;\n display: flex;\n flex-wrap: wrap;\n padding: 10px / 2;\n}\n.perseus-editor-widgets-selectors select {\n margin: 2px;\n}\n.perseus-editor-widgets > div.selected > strong {\n background-color: #ddf;\n}\n.perseus-editor-widgets .warning {\n background-color: #ffcccc;\n padding: 4px;\n margin: 4px;\n}\n.perseus-editor-word-count {\n cursor: help;\n flex: 1;\n float: right;\n margin-right: 3px;\n margin-top: 2px;\n text-align: right;\n}\n.MathJax .math {\n color: inherit;\n}\n#perseus {\n margin: 20px;\n}\n#perseus #problemarea #workarea {\n margin: 0;\n}\n#perseus #problemarea #workarea .perseus-image-caption {\n top: 0px !important;\n}\n#perseus .perseus-question-container > div,\n#perseus .perseus-answer-container > div {\n padding-bottom: 25px;\n}\n#perseus .add-choice-container,\n#perseus .add-hint-container {\n display: flex;\n flex-direction: row;\n margin-bottom: 20px;\n text-align: left;\n}\n#problemarea {\n font-size: 14px;\n position: relative;\n float: left;\n padding-bottom: 38px;\n}\n#problemarea a:link,\n#problemarea input,\n#problemarea label,\n#problemarea select {\n /* for dropdowns */\n position: relative;\n z-index: 3;\n /* interactive-content */\n}\n.perseus-editor-table {\n clear: both;\n display: table;\n table-layout: fixed;\n}\n.perseus-editor-row {\n display: table-row;\n}\n.perseus-editor-left-cell {\n display: table-cell;\n padding-right: 30px;\n vertical-align: top;\n width: 360px;\n max-width: 360px;\n min-width: 360px;\n}\n.perseus-editor-right-cell {\n box-sizing: border-box;\n display: table-cell;\n padding: 30px;\n padding-top: 5px;\n vertical-align: top;\n}\n.perseus-hint-editor {\n padding-bottom: 20px;\n}\n.perseus-hint-editor .perseus-single-editor {\n margin-bottom: 5px;\n}\n.perseus-hint-editor .reorder-hints button {\n font-size: 16px;\n}\n.perseus-hint-editor .reorder-hints button:hover,\n.perseus-hint-editor .reorder-hints button:active {\n color: #000;\n text-decoration: none;\n}\n.perseus-hint-editor .reorder-hints button.hidden {\n visibility: hidden;\n}\n.perseus-hint-editor .remove-hint {\n float: right;\n font-size: 13px;\n padding: 0 10px;\n}\n.perseus-hints-editor .add-hint {\n font-size: 13px;\n}\n.perseus-hints-editor\n .perseus-editor-row:first-child\n .perseus-editor-right-cell {\n border-top: 0;\n}\n.perseus-hint-editor + div .perseus-hint-renderer {\n width: 100%;\n}\n.perseus-hint-editor + div .perseus-hint-renderer div.paragraph {\n margin: 0px 0px 22px 0px;\n}\n.perseus-article-editor {\n margin-bottom: 20px;\n margin-top: 20px;\n}\n.perseus-article-editor .perseus-editor-table {\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .perseus-single-editor {\n margin-bottom: 10px;\n}\n.perseus-article-editor .section-control-button,\n.perseus-article-editor .step-control-button {\n font-size: 13px;\n padding: 2px 10px;\n margin: 0 2px;\n}\n.perseus-article-editor .perseus-editor-left-cell {\n min-width: 360px;\n}\n.perseus-article-editor .mobile-preview,\n.perseus-article-editor .desktop-preview,\n.perseus-article-editor .editor-preview,\n.perseus-article-editor .standalone-preview {\n box-sizing: border-box;\n}\n.perseus-article-editor .mobile-preview {\n border: 1px solid rgba(0, 0, 0, 0.29);\n max-width: 322px;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);\n padding: 32px 16px;\n}\n.perseus-article-editor .desktop-preview {\n border: 1px solid transparent;\n padding: 32px 20px;\n}\n.perseus-article-editor .editor-preview {\n display: table-cell;\n}\n.perseus-article-editor .editor-preview.full-width {\n width: 100%;\n}\n.perseus-article-editor .editor-preview .desktop-preview {\n border: 1px solid rgba(0, 0, 0, 0.29);\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);\n width: 100%;\n}\n.perseus-article-editor .standalone-preview .mobile-preview,\n.perseus-article-editor .standalone-preview .desktop-preview {\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .json-editor {\n margin: auto;\n max-width: 688px;\n}\n.perseus-article-editor .perseus-json-editor {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .json-editor-warning {\n margin-bottom: 10px;\n text-align: center;\n}\n.perseus-article-editor .framework-perseus.perseus-article {\n box-sizing: border-box;\n}\n.perseus-article-editor .framework-perseus.perseus-article * {\n box-sizing: inherit;\n}\n.perseus-article-editor .perseus-editor-left-cell > .pod-title {\n padding: 4px 9px;\n}\n.perseus-widget-dropdown input[type=\"text\"] {\n border: 1px solid #ccc;\n border-radius: 5px;\n padding: 5px;\n}\n.perseus-widget-dropdown input[type=\"text\"].correct {\n background: #aaffaa;\n}\n.perseus-widget-dropdown input[type=\"text\"].incorrect {\n background: #ffcccc;\n}\n.perseus-widget-dropdown .dropdown-choices {\n margin: 20px 0;\n}\n.perseus-widget-dropdown .dropdown-choices input[type=\"text\"] {\n margin: 0 5px;\n width: 70%;\n}\n.perseus-widget-dropdown .dropdown-info {\n display: inline-flex;\n margin-bottom: 16px;\n}\n.perseus-widget-dropdown .dropdown-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-width: 0;\n margin-bottom: 16px;\n}\n.perseus-widget-dropdown .remove-choice {\n margin-bottom: 10px;\n}\n.perseus-input-number-editor {\n font-family: Lato, \"Noto Sans\", sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n}\n.perseus-input-number-editor .answer-option .unsimplified-options {\n min-height: 48px;\n}\n.perseus-input-number-editor .perseus-textarea-pair {\n font-size: 16px;\n}\n.perseus-input-number-editor .perseus-textarea-pair .perseus-textarea-underlay {\n margin-bottom: 26px;\n}\n.perseus-input-number-editor .perseus-textarea-pair textarea {\n background-color: #ffffff;\n border: 1px solid rgba(33, 36, 44, 0.5);\n border-radius: 4px;\n}\n.perseus-input-number-editor .input-answer-editor-value,\n.perseus-input-number-editor .input-answer-editor-message {\n display: inline-block;\n}\n.perseus-input-number-editor .input-answer-editor-value-container {\n display: block;\n}\n.perseus-input-number-editor .input-answer-editor-value-container input {\n background: #ffffff;\n border: 1px solid rgba(33, 36, 44, 0.5);\n border-radius: 4px;\n color: #21242c;\n font-family: Lato, \"Noto Sans\", sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n outline-offset: -2px;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .numeric-input-value {\n margin-left: 8px;\n width: 6em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .max-error-input-value {\n display: none;\n width: 3em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .max-error-plusmn {\n cursor: default;\n display: none;\n height: 32px;\n padding-top: 4px;\n text-align: center;\n vertical-align: top;\n width: 1em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .numeric-input-value,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .numeric-input-value {\n border-right: none;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .max-error-input-value,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .max-error-input-value {\n border-left: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-block;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .max-error-plusmn,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .max-error-plusmn {\n border-top: 1px solid rgba(33, 36, 44, 0.5);\n border-bottom: 1px solid rgba(33, 36, 44, 0.5);\n display: inline-block;\n}\n.perseus-input-number-editor .options-toggle,\n.perseus-input-number-editor .answer-trash,\n.perseus-input-number-editor .answer-status {\n height: 26px;\n line-height: 26px;\n outline-offset: -3px;\n vertical-align: middle;\n}\n.perseus-input-number-editor .value-divider {\n border-top: 1px solid #ccc;\n}\n.perseus-input-number-editor .options-toggle,\n.perseus-input-number-editor .answer-trash {\n border-left: 1px solid #ccc;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n text-decoration: none;\n width: 20%;\n}\n.perseus-input-number-editor .options-toggle {\n background-color: #eee;\n color: #444;\n}\n.perseus-input-number-editor .options-toggle:hover {\n background-color: #ccc;\n}\n.perseus-input-number-editor .answer-trash {\n background-color: #c04f03;\n background-image: linear-gradient(to bottom, #e35d04, #c04f03);\n color: #fff;\n}\n.perseus-input-number-editor .answer-trash:hover {\n color: #fff;\n background-image: linear-gradient(to bottom, #f46e15, #d16014);\n}\n.perseus-input-number-editor .is-strict-indicator {\n background-color: #d9edf7;\n border-bottom: 1px solid #ccc;\n border-right: 1px solid #ccc;\n cursor: default;\n font-size: 16px;\n line-height: 12px;\n height: 12px;\n width: 12px;\n text-align: center;\n position: absolute;\n top: 0;\n right: auto;\n bottom: auto;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .simplify-indicator {\n border-top: 1px solid #ccc;\n border-right: 1px solid #ccc;\n cursor: default;\n font-size: 10px;\n line-height: 13px;\n height: 13px;\n width: 12px;\n text-align: center;\n position: absolute;\n top: 12px;\n right: auto;\n bottom: auto;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .simplify-indicator.optional {\n background-color: #aaffaa;\n}\n.perseus-input-number-editor .simplify-indicator.enforced {\n background-color: #ffcccc;\n}\n.perseus-input-number-editor .answer-status {\n color: inherit;\n display: inline-block;\n text-align: center;\n text-decoration: none;\n width: 60%;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .answer-status.wrong {\n background-color: #ffcccc;\n}\n.perseus-input-number-editor .answer-status.correct {\n background-color: #aaffaa;\n}\n.perseus-input-number-editor .answer-status.ungraded {\n background-color: #d9edf7;\n}\n.perseus-input-number-editor .input-answer-editor-message {\n margin-left: 5px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor {\n font-family: \"Lucida Grande\";\n width: 230px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-pair\n > textarea,\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-underlay {\n padding: 5px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-pair {\n border-color: #ccc;\n border-radius: 3px;\n min-height: 53px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-underlay {\n margin-bottom: 0;\n}\n.perseus-widget-radio {\n margin-bottom: 10px;\n}\n.perseus-widget-radio .choice-editor .perseus-single-editor {\n margin-bottom: 0;\n}\n.perseus-widget-radio .choice-editor.correct textarea {\n background: #aaffaa;\n}\n.perseus-widget-radio .choice-editor.incorrect textarea {\n background: #ffcccc;\n}\n.perseus-widget-radio textarea::placeholder {\n color: #777;\n}\n.perseus-widget-radio .clue-editor .perseus-textarea-pair {\n border-top: 0;\n}\n.perseus-widget-radio .choice-clue-editors,\n.perseus-widget-radio .choice-editor,\n.perseus-widget-radio .clue-editor {\n display: inline-block;\n width: 100%;\n}\n.perseus-widget-radio .perseus-single-editor {\n border: 0;\n display: inline-block;\n margin: 0 0 5px;\n vertical-align: top;\n}\n.perseus-widget-radio .perseus-single-editor p {\n margin: 0;\n}\n.perseus-widget-radio .perseus-textarea-pair,\n.perseus-widget-radio .perseus-textarea-underlay {\n /* Wrap when text area has a long image link that overflows. */\n overflow-wrap: anywhere;\n display: block;\n}\n.perseus-widget-radio .perseus-textarea-pair > textarea,\n.perseus-widget-radio .perseus-textarea-pair > .perseus-textarea-underlay {\n padding: 5px;\n}\n.perseus-widget-editor-content .add-choice-container .simple-button {\n margin-right: 10px;\n}\n.perseus-widget-editor-content .perseus-widget-radio {\n position: static;\n}\n.perseus-widget-editor-content .perseus-widget-radio .checkbox {\n position: relative;\n top: -10px;\n}\n.perseus-widget-editor-content .perseus-radio-option.none-of-above:before {\n content: \"None of the above\";\n display: block;\n font-style: italic;\n font-weight: bold;\n}\n.perseus-widget-editor-content\n .perseus-radio-option.none-of-above\n .choice-editor.incorrect {\n opacity: 0.5;\n}\n#solutionarea .perseus-widget-radio li {\n padding: 7px 0;\n}\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-single-editor {\n width: 80px;\n margin-bottom: 6px;\n}\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-textarea-pair,\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-single-editor {\n height: 50px;\n}\n.categorization-container.categorization-container-editor {\n width: 350px;\n margin-bottom: 160px;\n}\n.categorization-container.categorization-container-editor .card input {\n margin: 7px 3px 7px 13px;\n font-size: 12px;\n display: block;\n width: 81%;\n}\n.categorization-container.categorization-container-editor .category {\n float: left;\n padding: 5px;\n width: 160px;\n}\n.categorization-container.categorization-container-editor .categories {\n width: 176px;\n}\n.categorization-container.categorization-container-editor\n .perseus-textarea-underlay {\n margin-bottom: 0;\n}\n.categorization-container.categorization-container-editor .drag-bar {\n float: left;\n font-size: 10px;\n padding: 2px 0;\n height: 70%;\n margin-top: 3px;\n}\n.categorization-container.categorization-container-editor .header {\n margin-bottom: 8px;\n}\n.categorization-container.categorization-container-editor .header input {\n display: block;\n margin-right: 24px;\n width: 76%;\n}\n.categorization-container.categorization-container-editor .header .remove {\n position: relative;\n top: -14px;\n left: 12px;\n float: right;\n width: 20px;\n height: 20px;\n padding: 2px;\n color: #666;\n cursor: pointer;\n}\n.categorization-container.categorization-container-editor\n .header\n .remove:hover {\n color: #333;\n}\n.categorization-container.categorization-container-editor .delete-item-area {\n position: absolute;\n width: 150px;\n height: 60px;\n padding-top: 40px;\n bottom: -150px;\n left: 10px;\n border: dashed 2px #888;\n color: #888;\n text-align: center;\n font-size: 20px;\n}\n.categorization-container.categorization-container-editor\n .delete-item-area.target {\n border-color: black;\n color: #333;\n}\n.categorization-container.categorization-container-editor .card {\n width: 130px;\n padding: 0;\n}\n.categorization-container.categorization-container-editor\n .card.dragging\n .drag-bar {\n margin-left: 2px;\n}\n.categorization-editor-area {\n height: 30px;\n}\n.categorization-editor-area .add-item {\n float: left;\n margin-left: 17px;\n}\n.categorization-editor-area .add-category {\n margin-left: 173px;\n}\n.perseus-widget-interactive-graph {\n display: block;\n}\n.perseus-widget-plotter-editor .plotter-categories,\n.perseus-widget-plotter-editor .pic-url {\n width: 70%;\n}\n.perseus-text-list-editor input[type=\"text\"] {\n padding: 3px;\n margin-right: 5px;\n min-width: 20px;\n max-width: 340px;\n}\n.perseus-text-list-editor.layout-horizontal input[type=\"text\"] {\n float: left;\n}\n.perseus-matcher-editor .perseus-text-list-editor {\n float: left;\n max-width: 50%;\n}\n.perseus-matcher-editor .perseus-text-list-editor input[type=\"text\"] {\n max-width: 90%;\n}\n.perseus-matcher-editor input[type=\"text\"] {\n width: 46%;\n}\n.perseus-matcher-editor input[type=\"text\"] + input[type=\"text\"] {\n margin-left: 2%;\n}\n.info-tip {\n display: inline-block;\n}\n.info-tip-content-container p {\n font-size: 12px;\n line-height: 1.4;\n margin: 0;\n}\n.info-tip-content-container p + p {\n margin-top: 22px;\n}\n.perseus-widget-interaction-editor\n .perseus-widget-interaction-editor-select-element {\n background-color: #eee;\n border: 1px solid #ddd;\n border-top: 0;\n border-radius: 0 0 3px 3px;\n padding: 5px 10px;\n margin: 20px -11px -11px -11px;\n}\n.perseus-widget-interaction-editor .colorpicker-circle {\n border-radius: 50%;\n width: 14px;\n height: 14px;\n position: absolute;\n left: 5px;\n top: 5px;\n}\n.perseus-interaction-element {\n border: 1px solid #ddd;\n border-radius: 3px;\n}\n.perseus-interaction-element .perseus-interaction-element-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n border: 0;\n color: inherit;\n display: block;\n text-decoration: none;\n white-space: nowrap;\n font-size: 1em;\n overflow: hidden;\n}\n.perseus-interaction-element .perseus-interaction-element-title.closed {\n border-radius: 3px;\n}\n.perseus-interaction-element .perseus-interaction-element-title > svg {\n float: left;\n font-size: 14px;\n margin-right: 10px;\n}\n.perseus-interaction-element .perseus-interaction-element-content {\n border-radius: 0 0 3px 3px;\n border-top: 1px solid #ddd;\n padding: 10px;\n}\n.perseus-interaction-element\n .perseus-interaction-element-content\n .edit-controls {\n text-align: right;\n margin-top: -30px;\n}\n.perseus-interaction-element\n .perseus-interaction-element-content\n .edit-controls\n > button {\n background: #fff;\n border: 0;\n cursor: pointer;\n padding: 0;\n margin-left: 7px;\n font-size: 18px;\n color: #555;\n}\n.perseus-interaction-element .perseus-interaction-element-content.leave {\n display: none;\n}\n.button-set-separator {\n margin: 10px 0;\n}\n.perseus-widget-editor .unit-radio {\n color: black;\n text-decoration: none;\n}\n.unit-example-not-okay {\n color: red;\n}\n.unit-example-okay {\n color: green;\n}\n.pair-editor input {\n width: 120px;\n}\n.marvel-device.iphone6.silver:after {\n z-index: 1;\n}\n.perseus-diff {\n margin: 0 10px;\n}\n.perseus-diff .diff-header {\n font-size: 18px;\n padding: 10px 0;\n width: 50%;\n display: inline-block;\n}\n.perseus-diff .diff-header.collapsed {\n font-size: 14px;\n padding: 0px;\n}\n.perseus-diff .diff-body {\n border-top: 1px solid #e4e4e4;\n border-bottom: 1px solid #e4e4e4;\n}\n.perseus-diff .diff-row {\n width: 50%;\n white-space: pre-wrap;\n box-sizing: border-box;\n font-size: 14px;\n padding-right: 20px;\n padding-left: 10px;\n overflow: hidden;\n}\n.perseus-diff .diff-row.collapsed {\n color: #888;\n cursor: pointer;\n}\n.perseus-diff .diff-row.collapsed:hover {\n color: #666;\n}\n.perseus-diff .diff-row.collapsed:active {\n color: #444;\n}\n.perseus-diff .diff-row .diff-line {\n margin-bottom: 20px;\n}\n.perseus-diff .before {\n float: left;\n border-left: 1px solid #e4e4e4;\n}\n.perseus-diff .after {\n float: right;\n border-right: 1px solid #e4e4e4;\n border-left: 1px solid #e4e4e4;\n}\n.perseus-diff .inner-value {\n height: 100%;\n padding: 3px;\n}\n.perseus-diff .not-present {\n display: none;\n}\n.perseus-diff .blank-space {\n visibility: hidden;\n}\n.perseus-diff .added {\n background-color: #eeffee;\n}\n.perseus-diff .added.dark {\n background-color: #aaffaa;\n}\n.perseus-diff .removed {\n background-color: #ffeeee;\n}\n.perseus-diff .removed.dark {\n background-color: #ffaaaa;\n}\n.perseus-diff .image {\n display: inline-block;\n margin-left: 20px;\n margin-bottom: 10px;\n}\n.perseus-diff .image,\n.perseus-diff .image > div,\n.perseus-diff .image > img {\n max-height: 300px;\n max-width: 100%;\n}\n.perseus-diff .image-unchanged {\n border: 1px solid #aaaaaa;\n}\n.perseus-diff .image-added {\n border: 2px solid #aaffaa;\n}\n.perseus-diff .image-removed {\n border: 2px solid #ffaaaa;\n}\n.perseus-diff .diff-separator {\n border-bottom: 1px dashed #444;\n margin: 30px 0 10px 0;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["perseus-editor.css"],"names":[],"mappings":"AAAA,KACI,6BACJ,CACA,WACI,qBAAsB,CACtB,qBAAsB,CACtB,eAAgB,CAGhB,yBAA0B,CAF1B,gBAAiB,CACjB,gBAEJ,CACA,kBACI,iBACJ,CACA,QAEI,MAAS,CADT,iBAAkB,CAElB,OACJ,CACA,uBACI,qBAAsB,CACtB,UACJ,CACA,qBAEI,qBAAsB,CACtB,YAAa,CAFb,UAGJ,CACA,6BACI,wBACJ,CACA,uBACI,qBAAsB,CACtB,cAAe,CACf,eAAgB,CAChB,iBACJ,CACA,kDAKI,oBAAqB,CAJrB,iBAAkB,CAClB,kBAAmB,CACnB,YAAa,CACb,oBAEJ,CACA,oDAEI,qBAAsB,CADtB,eAEJ,CACA,6DACI,qBACJ,CACA,0DACI,qBACJ,CACA,gCACI,sBAAuB,CACvB,QAAS,CACT,qBAAsB,CACtB,YAAa,CACb,WAAY,CACZ,MAAO,CACP,eAAgB,CAChB,YAAa,CACb,iBAAkB,CAClB,WAAY,CACZ,KAAM,CACN,UACJ,CACA,oBACI,YAAa,CACb,UACJ,CACA,2FAE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B,CAC1B,YACJ,CACA,iFAII,gBAAiB,CADjB,gBAEJ,CACA,wFAII,eAAgB,CAChB,QAAS,CAKT,UAAW,CAJX,cAAe,CAGf,cAAe,CADf,eAAgB,CADhB,SAIJ,CACA,wEACI,YACJ,CACA,sBACI,aACJ,CACA,mCACI,UAAY,CACZ,oBACJ,CACA,uBACI,SACJ,CACA,mBACI,WACJ,CACA,mBACI,WACJ,CACA,oCACI,SACJ,CACA,cACI,aACJ,CACA,2BAII,oBAAqB,CAHrB,cAAe,CACf,cAAe,CACf,SAEJ,CACA,qCACI,cAAe,CACf,SACJ,CACA,yBAEI,+BAAgC,CADhC,4BAEJ,CACA,wBAGI,qBAAsB,CACtB,cAAe,CAGf,eAAgB,CADhB,iBAAkB,CADlB,kBAAmB,CAHnB,oBAAqB,CADrB,SAOJ,CACA,kCACI,UAAW,CACX,cACJ,CACA,wCACI,UACJ,CACA,yCACI,UACJ,CACA,mCACI,kBACJ,CACA,sBAEI,6BAA8B,CAD9B,UAEJ,CACA,qBAGI,6BAA8B,CAD9B,8BAA+B,CAD/B,WAGJ,CACA,2BACI,WAAY,CACZ,WACJ,CACA,2BACI,YACJ,CACA,2BACI,iBACJ,CACA,qBACI,qBACJ,CACA,0BACI,qBACJ,CACA,uBACI,qBACJ,CACA,4BACI,qBACJ,CACA,qBACI,oBAAqB,CAErB,kBAAmB,CADnB,gBAEJ,CACA,uEAGI,gBAAiB,CACjB,cACJ,CACA,+BACI,qBACJ,CACA,2BACI,qBACJ,CACA,6BACI,qBACJ,CACA,8BACI,6BAA8B,CAC9B,kBACJ","file":"index.css","sourcesContent":["code {\n font-family: Courier, monospace;\n}\n.pod-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n}\n.pod-title.closed {\n border-radius: 3px;\n}\n.smiley {\n position: absolute;\n left: 0px;\n top: 4px;\n}\n.perseus-single-editor {\n box-sizing: border-box;\n width: 100%;\n}\n.perseus-json-editor {\n width: 100%;\n font-family: monospace;\n height: 500px;\n}\n.perseus-json-editor.invalid {\n background-color: #ffe6e6;\n}\n.perseus-textarea-pair {\n border: 1px solid #ddd;\n font-size: 12px;\n line-height: 1.6;\n position: relative;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay {\n color: transparent;\n margin-bottom: 12px;\n padding: 10px;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b {\n font-weight: normal;\n background-color: #dfd;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b.selected {\n background-color: #ddf;\n}\n.perseus-textarea-pair > .perseus-textarea-underlay b.error {\n background-color: #fcc;\n}\n.perseus-textarea-pair > textarea {\n background: transparent;\n border: 0;\n box-sizing: border-box;\n font: inherit;\n height: 100%;\n left: 0;\n overflow: hidden;\n padding: 10px;\n position: absolute;\n resize: none;\n top: 0;\n width: 100%;\n}\n.perseus-widget-row {\n margin: 7px 0;\n width: 100%;\n}\n.perseus-widget-row .perseus-widget-left-col,\n.perseus-widget-row .perseus-widget-right-col {\n display: inline-block;\n width: 50%;\n}\n.perseus-widget-row .perseus-widget-left-col .range-input,\n.perseus-widget-row .perseus-widget-right-col .range-input {\n float: right;\n margin-right: 5px;\n}\n.perseus-widget-row > .range-input {\n margin-left: 10px;\n}\n.perseus-answer-options {\n border: 1px solid #ddd;\n padding: 10px;\n}\n.perseus-answer-options * {\n margin-bottom: 4px;\n}\n.perseus-answer-widget {\n border: 1px solid #ddd;\n border-radius: 0 0 3px 3px;\n padding: 10px;\n}\n.perseus-answer-none {\n border-bottom: 1px solid #ddd;\n}\n.perseus-answer-none > div {\n display: none;\n}\n.perseus-widget-editor {\n border: 1px solid #ddd;\n border-radius: 3px;\n margin-top: 10px;\n}\n.perseus-widget-editor .perseus-widget-editor-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n border: 0;\n display: flex;\n align-items: center;\n position: relative;\n cursor: pointer;\n}\n.perseus-widget-editor .perseus-widget-editor-title.closed {\n border-radius: 3px;\n}\n.perseus-widget-editor .perseus-widget-editor-title :first-child {\n flex-grow: 1;\n}\n.perseus-widget-editor .perseus-widget-editor-title > a {\n color: inherit;\n text-decoration: none;\n}\n.perseus-widget-editor .perseus-widget-editor-title .alignment {\n margin-right: 5px;\n}\n.perseus-widget-editor .perseus-widget-editor-title .simple-button {\n font-size: 13px;\n padding: 0 10px;\n}\n.perseus-widget-editor .perseus-widget-editor-content {\n border-radius: 0 0 3px 3px;\n border-top: 1px solid #ddd;\n padding: 10px;\n transition: all 0s;\n}\n.perseus-widget-editor .perseus-widget-editor-content.leave {\n display: none;\n}\n.perseus-widget-editor .perseus-widget-editor-content .inline-options {\n float: inline-start;\n /* flexbox and inline-block don't work on <legend> elements, so going old-school here */\n line-height: 24px;\n /* for alignment with items in same line (like pills or buttons) */\n padding-inline-end: 0.5em;\n}\n.perseus-widget-editor .perseus-widget-editor-content .tooltip-for-legend {\n display: inline-block;\n line-height: 24px;\n}\n.perseus-widget-editor .categorizer-container {\n overflow-x: scroll;\n}\n.perseus-widget-editor .section-accordion {\n display: flex;\n flex-direction: row;\n}\n.perseus-widget-editor .delete-item-button {\n align-self: center;\n padding-right: 0.5em;\n}\n.perseus-widget-editor-title-id {\n display: inline-flex;\n align-items: center;\n}\n.perseus-widget-editor-title-id > svg {\n float: left;\n font-size: 14px;\n margin-right: 10px;\n}\n.perseus-editor-accordion-container {\n display: inline-grid;\n width: 100%;\n}\n.perseus-editor-accordion-container.collapsed {\n grid-template-rows: 0fr;\n min-height: 0;\n visibility: hidden;\n transition:\n all 0.25s step-end,\n grid-template-rows 0.25s;\n}\n.perseus-editor-accordion-container.expanded {\n grid-template-rows: 1fr;\n min-height: 100%;\n visibility: visible;\n transition: grid-template-rows 0.5s;\n}\n.perseus-editor-accordion-container .perseus-editor-accordion-content {\n overflow: hidden;\n margin: 0 -1px;\n /* allows focus ring on accordion to show */\n padding: 0 1px;\n}\n.perseus-editor-widgets-selectors {\n background-color: #eee;\n border: 1px solid #ddd;\n border-top: 0;\n border-radius: 0 0 3px 3px;\n display: flex;\n flex-wrap: wrap;\n padding: 10px / 2;\n}\n.perseus-editor-widgets-selectors select {\n margin: 2px;\n}\n.perseus-editor-widgets > div.selected > strong {\n background-color: #ddf;\n}\n.perseus-editor-widgets .warning {\n background-color: #ffcccc;\n padding: 4px;\n margin: 4px;\n}\n.perseus-editor-word-count {\n cursor: help;\n flex: 1;\n float: right;\n margin-right: 3px;\n margin-top: 2px;\n text-align: right;\n}\n.MathJax .math {\n color: inherit;\n}\n#perseus {\n margin: 20px;\n}\n#perseus #problemarea #workarea {\n margin: 0;\n}\n#perseus #problemarea #workarea .perseus-image-caption {\n top: 0px !important;\n}\n#perseus .perseus-question-container > div,\n#perseus .perseus-answer-container > div {\n padding-bottom: 25px;\n}\n#perseus .add-choice-container,\n#perseus .add-hint-container {\n display: flex;\n flex-direction: row;\n margin-bottom: 20px;\n text-align: left;\n}\n#problemarea {\n font-size: 14px;\n position: relative;\n float: left;\n padding-bottom: 38px;\n}\n#problemarea a:link,\n#problemarea input,\n#problemarea label,\n#problemarea select {\n /* for dropdowns */\n position: relative;\n z-index: 3;\n /* interactive-content */\n}\n.perseus-editor-table {\n clear: both;\n display: table;\n table-layout: fixed;\n}\n.perseus-editor-row {\n display: table-row;\n}\n.perseus-editor-left-cell {\n display: table-cell;\n padding-right: 30px;\n vertical-align: top;\n width: 360px;\n max-width: 360px;\n min-width: 360px;\n}\n.perseus-editor-right-cell {\n box-sizing: border-box;\n display: table-cell;\n padding: 30px;\n padding-top: 5px;\n vertical-align: top;\n}\n.perseus-hint-editor {\n padding-bottom: 20px;\n}\n.perseus-hint-editor .perseus-single-editor {\n margin-bottom: 5px;\n}\n.perseus-hint-editor .reorder-hints button {\n font-size: 16px;\n}\n.perseus-hint-editor .reorder-hints button:hover,\n.perseus-hint-editor .reorder-hints button:active {\n color: #000;\n text-decoration: none;\n}\n.perseus-hint-editor .reorder-hints button.hidden {\n visibility: hidden;\n}\n.perseus-hint-editor .remove-hint {\n float: right;\n font-size: 13px;\n padding: 0 10px;\n}\n.perseus-hints-editor .add-hint {\n font-size: 13px;\n}\n.perseus-hints-editor\n .perseus-editor-row:first-child\n .perseus-editor-right-cell {\n border-top: 0;\n}\n.perseus-hint-editor + div .perseus-hint-renderer {\n width: 100%;\n}\n.perseus-hint-editor + div .perseus-hint-renderer div.paragraph {\n margin: 0px 0px 22px 0px;\n}\n.perseus-article-editor {\n margin-bottom: 20px;\n margin-top: 20px;\n}\n.perseus-article-editor .perseus-editor-table {\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .perseus-single-editor {\n margin-bottom: 10px;\n}\n.perseus-article-editor .section-control-button,\n.perseus-article-editor .step-control-button {\n font-size: 13px;\n padding: 2px 10px;\n margin: 0 2px;\n}\n.perseus-article-editor .perseus-editor-left-cell {\n min-width: 360px;\n}\n.perseus-article-editor .mobile-preview,\n.perseus-article-editor .desktop-preview,\n.perseus-article-editor .editor-preview,\n.perseus-article-editor .standalone-preview {\n box-sizing: border-box;\n}\n.perseus-article-editor .mobile-preview {\n border: 1px solid rgba(0, 0, 0, 0.29);\n max-width: 322px;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);\n padding: 32px 16px;\n}\n.perseus-article-editor .desktop-preview {\n border: 1px solid transparent;\n padding: 32px 20px;\n}\n.perseus-article-editor .editor-preview {\n display: table-cell;\n}\n.perseus-article-editor .editor-preview.full-width {\n width: 100%;\n}\n.perseus-article-editor .editor-preview .desktop-preview {\n border: 1px solid rgba(0, 0, 0, 0.29);\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);\n width: 100%;\n}\n.perseus-article-editor .standalone-preview .mobile-preview,\n.perseus-article-editor .standalone-preview .desktop-preview {\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .json-editor {\n margin: auto;\n max-width: 688px;\n}\n.perseus-article-editor .perseus-json-editor {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n.perseus-article-editor .json-editor-warning {\n margin-bottom: 10px;\n text-align: center;\n}\n.perseus-article-editor .framework-perseus.perseus-article {\n box-sizing: border-box;\n}\n.perseus-article-editor .framework-perseus.perseus-article * {\n box-sizing: inherit;\n}\n.perseus-article-editor .perseus-editor-left-cell > .pod-title {\n padding: 4px 9px;\n}\n.perseus-widget-dropdown input[type=\"text\"] {\n border: 1px solid #ccc;\n border-radius: 5px;\n padding: 5px;\n}\n.perseus-widget-dropdown input[type=\"text\"].correct {\n background: #aaffaa;\n}\n.perseus-widget-dropdown input[type=\"text\"].incorrect {\n background: #ffcccc;\n}\n.perseus-widget-dropdown .dropdown-choices {\n margin: 20px 0;\n}\n.perseus-widget-dropdown .dropdown-choices input[type=\"text\"] {\n margin: 0 5px;\n width: 70%;\n}\n.perseus-widget-dropdown .dropdown-info {\n display: inline-flex;\n margin-bottom: 16px;\n}\n.perseus-widget-dropdown .dropdown-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-width: 0;\n margin-bottom: 16px;\n}\n.perseus-widget-dropdown .remove-choice {\n margin-bottom: 10px;\n}\n.perseus-input-number-editor {\n font-family: Lato, \"Noto Sans\", sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n}\n.perseus-input-number-editor .answer-option .unsimplified-options {\n min-height: 48px;\n}\n.perseus-input-number-editor .perseus-textarea-pair {\n font-size: 16px;\n}\n.perseus-input-number-editor .perseus-textarea-pair .perseus-textarea-underlay {\n margin-bottom: 26px;\n}\n.perseus-input-number-editor .perseus-textarea-pair textarea {\n background-color: #ffffff;\n border: 1px solid rgba(33, 36, 44, 0.5);\n border-radius: 4px;\n}\n.perseus-input-number-editor .input-answer-editor-value,\n.perseus-input-number-editor .input-answer-editor-message {\n display: inline-block;\n}\n.perseus-input-number-editor .input-answer-editor-value-container {\n display: block;\n}\n.perseus-input-number-editor .input-answer-editor-value-container input {\n background: #ffffff;\n border: 1px solid rgba(33, 36, 44, 0.5);\n border-radius: 4px;\n color: #21242c;\n font-family: Lato, \"Noto Sans\", sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n outline-offset: -2px;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .numeric-input-value {\n margin-left: 8px;\n width: 6em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .max-error-input-value {\n display: none;\n width: 3em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container\n .max-error-plusmn {\n cursor: default;\n display: none;\n height: 32px;\n padding-top: 4px;\n text-align: center;\n vertical-align: top;\n width: 1em;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .numeric-input-value,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .numeric-input-value {\n border-right: none;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .max-error-input-value,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .max-error-input-value {\n border-left: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-block;\n}\n.perseus-input-number-editor\n .input-answer-editor-value-container.with-max-error\n .max-error-plusmn,\n.perseus-input-number-editor\n .input-answer-editor-value-container:focus-within\n .max-error-plusmn {\n border-top: 1px solid rgba(33, 36, 44, 0.5);\n border-bottom: 1px solid rgba(33, 36, 44, 0.5);\n display: inline-block;\n}\n.perseus-input-number-editor .options-toggle,\n.perseus-input-number-editor .answer-trash,\n.perseus-input-number-editor .answer-status {\n height: 26px;\n line-height: 26px;\n outline-offset: -3px;\n vertical-align: middle;\n}\n.perseus-input-number-editor .value-divider {\n border-top: 1px solid #ccc;\n}\n.perseus-input-number-editor .options-toggle,\n.perseus-input-number-editor .answer-trash {\n border-left: 1px solid #ccc;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n text-decoration: none;\n width: 20%;\n}\n.perseus-input-number-editor .options-toggle {\n background-color: #eee;\n color: #444;\n}\n.perseus-input-number-editor .options-toggle:hover {\n background-color: #ccc;\n}\n.perseus-input-number-editor .answer-trash {\n background-color: #c04f03;\n background-image: linear-gradient(to bottom, #e35d04, #c04f03);\n color: #fff;\n}\n.perseus-input-number-editor .answer-trash:hover {\n color: #fff;\n background-image: linear-gradient(to bottom, #f46e15, #d16014);\n}\n.perseus-input-number-editor .is-strict-indicator {\n background-color: #d9edf7;\n border-bottom: 1px solid #ccc;\n border-right: 1px solid #ccc;\n cursor: default;\n font-size: 16px;\n line-height: 12px;\n height: 12px;\n width: 12px;\n text-align: center;\n position: absolute;\n top: 0;\n right: auto;\n bottom: auto;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .simplify-indicator {\n border-top: 1px solid #ccc;\n border-right: 1px solid #ccc;\n cursor: default;\n font-size: 10px;\n line-height: 13px;\n height: 13px;\n width: 12px;\n text-align: center;\n position: absolute;\n top: 12px;\n right: auto;\n bottom: auto;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .simplify-indicator.optional {\n background-color: #aaffaa;\n}\n.perseus-input-number-editor .simplify-indicator.enforced {\n background-color: #ffcccc;\n}\n.perseus-input-number-editor .answer-status {\n color: inherit;\n display: inline-block;\n text-align: center;\n text-decoration: none;\n width: 60%;\n -webkit-user-select: none;\n user-select: none;\n}\n.perseus-input-number-editor .answer-status.wrong {\n background-color: #ffcccc;\n}\n.perseus-input-number-editor .answer-status.correct {\n background-color: #aaffaa;\n}\n.perseus-input-number-editor .answer-status.ungraded {\n background-color: #d9edf7;\n}\n.perseus-input-number-editor .input-answer-editor-message {\n margin-left: 5px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor {\n font-family: \"Lucida Grande\";\n width: 230px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-pair\n > textarea,\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-underlay {\n padding: 5px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-pair {\n border-color: #ccc;\n border-radius: 3px;\n min-height: 53px;\n}\n.perseus-input-number-editor\n .input-answer-editor-message\n .perseus-single-editor\n .perseus-textarea-underlay {\n margin-bottom: 0;\n}\n.perseus-widget-radio {\n margin-bottom: 10px;\n}\n.perseus-widget-radio .choice-editor .perseus-single-editor {\n margin-bottom: 0;\n}\n.perseus-widget-radio .choice-editor.correct textarea {\n background: #aaffaa;\n}\n.perseus-widget-radio .choice-editor.incorrect textarea {\n background: #ffcccc;\n}\n.perseus-widget-radio textarea::placeholder {\n color: #777;\n}\n.perseus-widget-radio .rationale-editor .perseus-textarea-pair {\n border-top: 0;\n}\n.perseus-widget-radio .choice-rationale-editors,\n.perseus-widget-radio .choice-editor,\n.perseus-widget-radio .rationale-editor {\n display: inline-block;\n width: 100%;\n}\n.perseus-widget-radio .perseus-single-editor {\n border: 0;\n display: inline-block;\n margin: 0 0 5px;\n vertical-align: top;\n}\n.perseus-widget-radio .perseus-single-editor p {\n margin: 0;\n}\n.perseus-widget-radio .perseus-textarea-pair,\n.perseus-widget-radio .perseus-textarea-underlay {\n /* Wrap when text area has a long image link that overflows. */\n overflow-wrap: anywhere;\n display: block;\n}\n.perseus-widget-radio .perseus-textarea-pair > textarea,\n.perseus-widget-radio .perseus-textarea-pair > .perseus-textarea-underlay {\n padding: 5px;\n}\n.perseus-widget-editor-content .add-choice-container .simple-button {\n margin-right: 10px;\n}\n.perseus-widget-editor-content .perseus-widget-radio {\n position: static;\n}\n.perseus-widget-editor-content .perseus-widget-radio .checkbox {\n position: relative;\n top: -10px;\n}\n.perseus-widget-editor-content .perseus-radio-option.none-of-above:before {\n content: \"None of the above\";\n display: block;\n font-style: italic;\n font-weight: bold;\n}\n.perseus-widget-editor-content\n .perseus-radio-option.none-of-above\n .choice-editor.incorrect {\n opacity: 0.5;\n}\n#solutionarea .perseus-widget-radio li {\n padding: 7px 0;\n}\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-single-editor {\n width: 80px;\n margin-bottom: 6px;\n}\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-textarea-pair,\n.framework-perseus\n table.perseus-widget-table-of-values\n th\n .perseus-single-editor {\n height: 50px;\n}\n.categorization-container.categorization-container-editor {\n width: 350px;\n margin-bottom: 160px;\n}\n.categorization-container.categorization-container-editor .card input {\n margin: 7px 3px 7px 13px;\n font-size: 12px;\n display: block;\n width: 81%;\n}\n.categorization-container.categorization-container-editor .category {\n float: left;\n padding: 5px;\n width: 160px;\n}\n.categorization-container.categorization-container-editor .categories {\n width: 176px;\n}\n.categorization-container.categorization-container-editor\n .perseus-textarea-underlay {\n margin-bottom: 0;\n}\n.categorization-container.categorization-container-editor .drag-bar {\n float: left;\n font-size: 10px;\n padding: 2px 0;\n height: 70%;\n margin-top: 3px;\n}\n.categorization-container.categorization-container-editor .header {\n margin-bottom: 8px;\n}\n.categorization-container.categorization-container-editor .header input {\n display: block;\n margin-right: 24px;\n width: 76%;\n}\n.categorization-container.categorization-container-editor .header .remove {\n position: relative;\n top: -14px;\n left: 12px;\n float: right;\n width: 20px;\n height: 20px;\n padding: 2px;\n color: #666;\n cursor: pointer;\n}\n.categorization-container.categorization-container-editor\n .header\n .remove:hover {\n color: #333;\n}\n.categorization-container.categorization-container-editor .delete-item-area {\n position: absolute;\n width: 150px;\n height: 60px;\n padding-top: 40px;\n bottom: -150px;\n left: 10px;\n border: dashed 2px #888;\n color: #888;\n text-align: center;\n font-size: 20px;\n}\n.categorization-container.categorization-container-editor\n .delete-item-area.target {\n border-color: black;\n color: #333;\n}\n.categorization-container.categorization-container-editor .card {\n width: 130px;\n padding: 0;\n}\n.categorization-container.categorization-container-editor\n .card.dragging\n .drag-bar {\n margin-left: 2px;\n}\n.categorization-editor-area {\n height: 30px;\n}\n.categorization-editor-area .add-item {\n float: left;\n margin-left: 17px;\n}\n.categorization-editor-area .add-category {\n margin-left: 173px;\n}\n.perseus-widget-interactive-graph {\n display: block;\n}\n.perseus-widget-plotter-editor .plotter-categories,\n.perseus-widget-plotter-editor .pic-url {\n width: 70%;\n}\n.perseus-text-list-editor input[type=\"text\"] {\n padding: 3px;\n margin-right: 5px;\n min-width: 20px;\n max-width: 340px;\n}\n.perseus-text-list-editor.layout-horizontal input[type=\"text\"] {\n float: left;\n}\n.perseus-matcher-editor .perseus-text-list-editor {\n float: left;\n max-width: 50%;\n}\n.perseus-matcher-editor .perseus-text-list-editor input[type=\"text\"] {\n max-width: 90%;\n}\n.perseus-matcher-editor input[type=\"text\"] {\n width: 46%;\n}\n.perseus-matcher-editor input[type=\"text\"] + input[type=\"text\"] {\n margin-left: 2%;\n}\n.info-tip {\n display: inline-block;\n}\n.info-tip-content-container p {\n font-size: 12px;\n line-height: 1.4;\n margin: 0;\n}\n.info-tip-content-container p + p {\n margin-top: 22px;\n}\n.perseus-widget-interaction-editor\n .perseus-widget-interaction-editor-select-element {\n background-color: #eee;\n border: 1px solid #ddd;\n border-top: 0;\n border-radius: 0 0 3px 3px;\n padding: 5px 10px;\n margin: 20px -11px -11px -11px;\n}\n.perseus-widget-interaction-editor .colorpicker-circle {\n border-radius: 50%;\n width: 14px;\n height: 14px;\n position: absolute;\n left: 5px;\n top: 5px;\n}\n.perseus-interaction-element {\n border: 1px solid #ddd;\n border-radius: 3px;\n}\n.perseus-interaction-element .perseus-interaction-element-title {\n background-color: #eee;\n border: 1px solid #ddd;\n border-bottom: 0;\n font-size: 1.25em;\n padding: 4px 10px;\n border-radius: 3px 3px 0 0;\n border: 0;\n color: inherit;\n display: block;\n text-decoration: none;\n white-space: nowrap;\n font-size: 1em;\n overflow: hidden;\n}\n.perseus-interaction-element .perseus-interaction-element-title.closed {\n border-radius: 3px;\n}\n.perseus-interaction-element .perseus-interaction-element-title > svg {\n float: left;\n font-size: 14px;\n margin-right: 10px;\n}\n.perseus-interaction-element .perseus-interaction-element-content {\n border-radius: 0 0 3px 3px;\n border-top: 1px solid #ddd;\n padding: 10px;\n}\n.perseus-interaction-element\n .perseus-interaction-element-content\n .edit-controls {\n text-align: right;\n margin-top: -30px;\n}\n.perseus-interaction-element\n .perseus-interaction-element-content\n .edit-controls\n > button {\n background: #fff;\n border: 0;\n cursor: pointer;\n padding: 0;\n margin-left: 7px;\n font-size: 18px;\n color: #555;\n}\n.perseus-interaction-element .perseus-interaction-element-content.leave {\n display: none;\n}\n.button-set-separator {\n margin: 10px 0;\n}\n.perseus-widget-editor .unit-radio {\n color: black;\n text-decoration: none;\n}\n.unit-example-not-okay {\n color: red;\n}\n.unit-example-okay {\n color: green;\n}\n.pair-editor input {\n width: 120px;\n}\n.marvel-device.iphone6.silver:after {\n z-index: 1;\n}\n.perseus-diff {\n margin: 0 10px;\n}\n.perseus-diff .diff-header {\n font-size: 18px;\n padding: 10px 0;\n width: 50%;\n display: inline-block;\n}\n.perseus-diff .diff-header.collapsed {\n font-size: 14px;\n padding: 0px;\n}\n.perseus-diff .diff-body {\n border-top: 1px solid #e4e4e4;\n border-bottom: 1px solid #e4e4e4;\n}\n.perseus-diff .diff-row {\n width: 50%;\n white-space: pre-wrap;\n box-sizing: border-box;\n font-size: 14px;\n padding-right: 20px;\n padding-left: 10px;\n overflow: hidden;\n}\n.perseus-diff .diff-row.collapsed {\n color: #888;\n cursor: pointer;\n}\n.perseus-diff .diff-row.collapsed:hover {\n color: #666;\n}\n.perseus-diff .diff-row.collapsed:active {\n color: #444;\n}\n.perseus-diff .diff-row .diff-line {\n margin-bottom: 20px;\n}\n.perseus-diff .before {\n float: left;\n border-left: 1px solid #e4e4e4;\n}\n.perseus-diff .after {\n float: right;\n border-right: 1px solid #e4e4e4;\n border-left: 1px solid #e4e4e4;\n}\n.perseus-diff .inner-value {\n height: 100%;\n padding: 3px;\n}\n.perseus-diff .not-present {\n display: none;\n}\n.perseus-diff .blank-space {\n visibility: hidden;\n}\n.perseus-diff .added {\n background-color: #eeffee;\n}\n.perseus-diff .added.dark {\n background-color: #aaffaa;\n}\n.perseus-diff .removed {\n background-color: #ffeeee;\n}\n.perseus-diff .removed.dark {\n background-color: #ffaaaa;\n}\n.perseus-diff .image {\n display: inline-block;\n margin-left: 20px;\n margin-bottom: 10px;\n}\n.perseus-diff .image,\n.perseus-diff .image > div,\n.perseus-diff .image > img {\n max-height: 300px;\n max-width: 100%;\n}\n.perseus-diff .image-unchanged {\n border: 1px solid #aaaaaa;\n}\n.perseus-diff .image-added {\n border: 2px solid #aaffaa;\n}\n.perseus-diff .image-removed {\n border: 2px solid #ffaaaa;\n}\n.perseus-diff .diff-separator {\n border-bottom: 1px dashed #444;\n margin: 30px 0 10px 0;\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
|
|
|
58
58
|
import Link$1 from '@khanacademy/wonder-blocks-link';
|
|
59
59
|
import plusIcon from '@phosphor-icons/core/bold/plus-bold.svg';
|
|
60
60
|
|
|
61
|
-
const libName="@khanacademy/perseus-editor";const libVersion="25.0
|
|
61
|
+
const libName="@khanacademy/perseus-editor";const libVersion="25.1.0";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
62
62
|
|
|
63
63
|
var jsxRuntime = {exports: {}};
|
|
64
64
|
|
|
@@ -1426,7 +1426,7 @@ class WidgetSelect extends React.Component{shouldComponentUpdate(){return false}
|
|
|
1426
1426
|
|
|
1427
1427
|
class TexErrorView extends React.Component{render(){const{errorList}=this.props;const{showErrors}=this.state;return jsxRuntimeExports.jsxs(View,{style:styles$R.errorContainer,children:[jsxRuntimeExports.jsxs(View,{style:styles$R.title,onClick:this.handleToggleTexErrors,children:[jsxRuntimeExports.jsx(ToggleableCaret,{isExpanded:showErrors})," TeX Errors (",errorList.length,")"]}),showErrors&&jsxRuntimeExports.jsx(View,{style:styles$R.errorExplanation,children:"If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."}),showErrors&&errorList.map((e,index)=>jsxRuntimeExports.jsxs(View,{style:styles$R.error,children:[jsxRuntimeExports.jsx(View,{style:{color:"red"},children:e.math}),jsxRuntimeExports.jsx(View,{children:e.message})]},index))]})}constructor(...args){super(...args),this.state={showErrors:false},this.handleToggleTexErrors=e=>{this.setState({showErrors:!this.state.showErrors});};}}const styles$R=StyleSheet.create({title:{backgroundColor:"#eee",fontSize:"1.25em",padding:"4px 10px",cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center"},errorContainer:{border:"1px solid #ddd",borderTop:"none"},errorExplanation:{padding:"4px 10px",backgroundColor:"pink"},error:{padding:"4px 10px"}});
|
|
1428
1428
|
|
|
1429
|
-
const widgetPlaceholder="[[☃ {id}]]";const widgetRegExp="(\\[\\[☃ {id}\\]\\])";const rWidgetSplit=new RegExp(widgetRegExp.replace("{id}","[a-z-]+ [0-9]+"),"g");const shortcutRegexp=/^\[\[([a-z-]+)$/;const ENDS_WITH_A_PARAGRAPH=/(?:\n{2,}|^\n*)$/;const TRAILING_NEWLINES=/(\n*)$/;const LEADING_NEWLINES=/^(\n*)/;const commafyInteger=n=>{let str=n.toString();if(str.length>=5){str=str.replace(/(\d)(?=(\d{3})+$)/g,"$1{,}");}return str};const makeEndWithAParagraphIfNecessary=content=>{if(!ENDS_WITH_A_PARAGRAPH.test(content)){const match=TRAILING_NEWLINES.exec(content);if(match){const newlines=match[1];return content+"\n\n".slice(0,2-newlines.length)}}return content};const makeStartWithAParagraphAlways=content=>{const match=LEADING_NEWLINES.exec(content);if(!match){return content}const newlines=match[1];return "\n\n".slice(0,2-newlines.length)+content};const IMAGE_REGEX$1=/!\[[^\]]*\]\(([^\s)]+)[^)]*\)/g;const allMatches=function(regex,str){const result=[];while(true){const match=regex.exec(str);if(!match){break}result.push(match);}return result};const imageUrlsFromContent=function(content){return allMatches(IMAGE_REGEX$1,content).map(capture=>capture[1])};class Editor extends React.Component{componentDidMount(){this.lastUserValue=null;this._sizeImages(this.props);$(this.textarea.current).on("copy cut",this._maybeCopyWidgets).on("paste",this._maybePasteWidgets);}UNSAFE_componentWillReceiveProps(nextProps){if(this.props.content!==nextProps.content){this.setState({textAreaValue:nextProps.content});}}componentDidUpdate(prevProps){const textarea=this.textarea.current;if(this.lastUserValue!=null&&textarea){textarea.focus();textarea.value=this.lastUserValue;textarea.selectionStart=0;textarea.setSelectionRange(0,prevProps.content.length);if(document.execCommand("insertText",false,this.props.content)===false){textarea.value=this.props.content;}this.lastUserValue=null;}if(this.props.content!==prevProps.content){this._sizeImages(this.props);}}componentWillUnmount(){clearTimeout(this.deferredChange);}getWidgetEditor(id,type){if(!Widgets.getEditor(type)){return}return createElement(WidgetEditor,{...this.props.widgets[id],ref:id,id:id,key:id,onChange:this._handleWidgetEditorChange.bind(this,id),onRemove:this._handleWidgetEditorRemove.bind(this,id),apiOptions:this.props.apiOptions,widgetIsOpen:this.props.widgetIsOpen})}render(){let pieces;let widgets;let underlayPieces;let widgetsDropDown;let templatesDropDown;let widgetsAndTemplates;let wordCountDisplay;const katexErrorList=[];if(this.props.showWordCount){const numChars=PerseusMarkdown.characterCount(this.props.content);const numWords=Math.floor(numChars/6);wordCountDisplay=jsxRuntimeExports.jsx("span",{className:"perseus-editor-word-count",title:"~"+commafyInteger(numWords)+" words ("+commafyInteger(numChars)+" characters)",children:commafyInteger(numWords)});}if(this.props.widgetEnabled){pieces=Util.split(this.props.content,rWidgetSplit);widgets={};underlayPieces=[];for(let i=0;i<pieces.length;i++){if(i%2===0){underlayPieces.push(pieces[i]);const ast=PerseusMarkdown.parse(pieces[i]);PerseusMarkdown.traverseContent(ast,node=>{if(node.type==="math"||node.type==="blockMath"){const content=preprocessTex(node.content);try{katex.renderToString(content,{colorIsTextColor:true});}catch(e){katexErrorList.push({math:content,message:e.message});}}});}else {const match=Util.rWidgetParts.exec(pieces[i]);if(match!=null){const id=match[1];const type=match[2];const duplicate=id in widgets;widgets[id]=this.getWidgetEditor(id,type);const classes=(duplicate||!widgets[id]?"error ":"")+("");const key=duplicate?i:id;underlayPieces.push(jsxRuntimeExports.jsx("b",{className:classes,children:pieces[i]},key));}}}this.widgetIds=_.keys(widgets);widgetsDropDown=jsxRuntimeExports.jsx(WidgetSelect,{onChange:this._addWidget});const insertTemplateString="Insert template…";templatesDropDown=jsxRuntimeExports.jsxs("select",{onChange:this.addTemplate,children:[jsxRuntimeExports.jsx("option",{value:"",children:insertTemplateString}),jsxRuntimeExports.jsx("option",{disabled:true,children:"--"}),jsxRuntimeExports.jsx("option",{value:"table",children:"Table"}),jsxRuntimeExports.jsx("option",{value:"titledTable",children:"Titled table"}),jsxRuntimeExports.jsx("option",{value:"alignment",children:"Aligned equations"}),jsxRuntimeExports.jsx("option",{value:"piecewise",children:"Piecewise function"}),jsxRuntimeExports.jsx("option",{disabled:true,children:"--"}),jsxRuntimeExports.jsx("option",{value:"allWidgets",children:"All widgets (for testing)"})]});if(!this.props.immutableWidgets){const widgetNodes=Object.values(widgets);widgetsAndTemplates=jsxRuntimeExports.jsxs("div",{className:"perseus-editor-widgets",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-widgets-selectors",children:[widgetsDropDown,templatesDropDown,wordCountDisplay]}),widgetNodes]});wordCountDisplay=null;}}else {underlayPieces=[this.props.content];}underlayPieces.push(jsxRuntimeExports.jsx("br",{},"end"));const completeTextarea=[jsxRuntimeExports.jsx("div",{className:"perseus-textarea-underlay",ref:this.underlay,children:underlayPieces},"underlay"),jsxRuntimeExports.jsx("textarea",{ref:this.textarea,onChange:this.handleChange,onKeyDown:this._handleKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,value:this.state.textAreaValue},"textarea")];let textareaWrapper;if(this.props.imageUploader){textareaWrapper=jsxRuntimeExports.jsx(DragTarget,{onDrop:this.handleDrop,className:"perseus-textarea-pair",children:completeTextarea});}else {textareaWrapper=jsxRuntimeExports.jsx("div",{className:"perseus-textarea-pair",children:completeTextarea});}const contentWithoutWidgets=this.props.content.replace(/\[\[\u2603 (([a-z-]+) ([0-9]+))\]\]/g,"");const noPrompt=contentWithoutWidgets.trim().length===0;const noWidgets=!/\[\[\u2603 (([a-z-]+) ([0-9]+))\]\]/g.test(this.props.content);const warningStyle={borderTop:"none",padding:4,backgroundColor:"pink"};return jsxRuntimeExports.jsxs("div",{className:"perseus-single-editor "+(this.props.className||""),children:[textareaWrapper,katexErrorList.length>0&&jsxRuntimeExports.jsx(TexErrorView,{errorList:katexErrorList}),this.props.warnNoPrompt&&noPrompt&&jsxRuntimeExports.jsx("div",{style:warningStyle,children:"Graded Groups should contain a prompt"}),this.props.warnNoWidgets&&noWidgets&&jsxRuntimeExports.jsx("div",{style:warningStyle,children:"Graded Groups should contain at least one widget"}),wordCountDisplay,widgetsAndTemplates]})}constructor(...args){super(...args),this.underlay=React.createRef(),this.textarea=React.createRef(),this.state={textAreaValue:this.props.content},this._handleWidgetEditorChange=(id,newWidgetInfo,cb,silent)=>{const widgets=Object.assign({},this.props.widgets);widgets[id]=Object.assign({},widgets[id],newWidgetInfo);this.props.onChange({widgets},cb,silent);},this._handleWidgetEditorRemove=id=>{if(!confirm("Are you sure you want to delete this item?")){return}const textarea=this.textarea.current;const re=new RegExp(widgetRegExp.replace("{id}",id),"gm");this.props.onChange({content:textarea?.value.replace(re,"")});},this._sizeImages=props=>{const imageUrls=imageUrlsFromContent(props.content);const images=_.pick(props.images,imageUrls);const newImageUrls=_.filter(imageUrls,url=>!images[url]);_.each(newImageUrls,url=>{Util.getImageSize(url,(width,height)=>{images[url]={width:width,height:height};props.onChange({images:_.clone(images)},null,true);});});},this.handleDrop=e=>{const{imageUploader}=this.props;let content=this.state.textAreaValue||"";const dataTransfer=e.dataTransfer;if(!dataTransfer||!imageUploader){return}const files=dataTransfer.files;if(files.length===0){const imageUrl=dataTransfer.getData("URL");if(imageUrl){const newContent=content+"\n\n";this.lastUserValue=this.props.content;this.props.onChange({content:newContent});}return}const origContent=this.state.textAreaValue;_(files).chain().map(function(file){if(!file.type.match("image.*")){return null}const sentinel="☃ "+_.uniqueId("image_");content+="\n\n";return {file:file,sentinel:sentinel}}).reject(_.isNull).tap(()=>{this.lastUserValue=origContent;this.props.onChange({content:content});}).each(fileAndSentinel=>{imageUploader(fileAndSentinel.file,url=>{this.lastUserValue=origContent;this.props.onChange({content:this.state.textAreaValue.replace(fileAndSentinel.sentinel,url)});});});},this.handleChange=e=>{clearTimeout(this.deferredChange);this.setState({textAreaValue:e.currentTarget.value});this.deferredChange=setTimeout(()=>{if(this.state.textAreaValue!==this.props.content){this.props.onChange({content:this.state.textAreaValue});}},this.props.apiOptions.editorChangeDelay);},this._handleKeyDown=e=>{e.stopPropagation();if(e.key==="Tab"){const textarea=this.textarea.current;const word=Util.textarea.getWordBeforeCursor(textarea);const matches=word.string.toLowerCase().match(shortcutRegexp);if(matches!=null){const text=matches[1];const widgets=Widgets.getAllWidgetTypes();const matchingWidgets=widgets.filter(name=>{return name.substring(0,text.length)===text});if(matchingWidgets.length===1){const widgetType=matchingWidgets[0];this._addWidgetToContent(this.props.content,[word.pos.start,word.pos.end+1],widgetType);}e.preventDefault();}}},this._maybeCopyWidgets=e=>{const textarea=e.currentTarget;const selectedText=textarea.value.substring(textarea.selectionStart,textarea.selectionEnd);const widgetNames=_.map(selectedText.match(rWidgetSplit),syntax=>{return Util.rWidgetParts.exec(syntax)[1]});const widgetData=_.pick(this.serialize().widgets,widgetNames);localStorage.perseusLastCopiedText=selectedText;localStorage.perseusLastCopiedWidgets=JSON.stringify(widgetData);Log.log(`Widgets copied: ${localStorage.perseusLastCopiedWidgets}`);},this._maybePasteWidgets=e=>{const widgetJSON=localStorage.perseusLastCopiedWidgets;const lastCopiedText=localStorage.perseusLastCopiedText;const textToBePasted=e.originalEvent.clipboardData.getData("text");if(widgetJSON&&lastCopiedText===textToBePasted){e.preventDefault();const widgetData=JSON.parse(widgetJSON);const safeWidgetMapping=this._safeWidgetNameMapping(widgetData);const safeWidgetData={};for(const[key,data]of Object.entries(widgetData)){safeWidgetData[safeWidgetMapping[key]]=data;}const newWidgets=_.extend(safeWidgetData,this.props.widgets);const safeText=lastCopiedText.replace(rWidgetSplit,syntax=>{const match=Util.rWidgetParts.exec(syntax);const completeWidget=match[0];const widget=match[1];return completeWidget.replace(widget,safeWidgetMapping[widget])});const textarea=e.currentTarget;const selectionStart=textarea.selectionStart;const newContent=this.state.textAreaValue.substr(0,selectionStart)+safeText+this.state.textAreaValue.substr(textarea.selectionEnd);this.lastUserValue=this.state.textAreaValue;this.props.onChange({content:newContent,widgets:newWidgets},()=>{const expectedCursorPosition=selectionStart+safeText.length;Util.textarea.moveCursor(textarea,expectedCursorPosition);});}},this._safeWidgetNameMapping=widgetData=>{const widgets=_.keys(widgetData).map(name=>name.split(" "));const widgetTypes=_.uniq(widgets.map(widget=>widget[0]));const existingWidgets=_.keys(this.props.widgets).map(name=>name.split(" "));const safeWidgetNums={};_.each(widgetTypes,type=>{safeWidgetNums[type]=_.chain(existingWidgets).filter(existingWidget=>existingWidget[0]===type).map(existingWidget=>+existingWidget[1]+1).max().value();safeWidgetNums[type]=Math.max(safeWidgetNums[type],1);});const safeWidgetMapping={};_.each(widgets,widget=>{const widgetName=widget.join(" ");const widgetType=widget[0];safeWidgetMapping[widgetName]=`${widgetType} ${safeWidgetNums[widgetType]}`;safeWidgetNums[widgetType]++;});return safeWidgetMapping},this._addWidgetToContent=(oldContent,cursorRange,widgetType)=>{const allWidgetIds=_.map(oldContent.match(rWidgetSplit),syntax=>{const match=Util.rWidgetParts.exec(syntax);const type=match[2];const num=+match[3];return [type,num]});const widgetNum=_.reduce(allWidgetIds,(currentNum,otherId)=>{const[otherType,otherNum]=otherId;if(otherType===widgetType){return Math.max(otherNum+1,currentNum)}return currentNum},1);const id=widgetType+" "+widgetNum;const widgetContent=widgetPlaceholder.replace("{id}",id);const isBlock=CoreWidgetRegistry.getDefaultAlignment(widgetType)==="block";const prelude=oldContent.slice(0,cursorRange[0]);const postlude=oldContent.slice(cursorRange[1]);const newPrelude=isBlock?makeEndWithAParagraphIfNecessary(prelude):prelude;const newPostlude=isBlock?makeStartWithAParagraphAlways(postlude):postlude;const newContent=newPrelude+widgetContent+newPostlude;const newWidgets={...this.props.widgets};newWidgets[id]={options:Widgets.getEditor(widgetType)?.defaultProps,type:widgetType,version:Widgets.getVersion(widgetType)};this.lastUserValue=this.props.content;this.props.onChange({content:newContent,widgets:newWidgets},()=>{if(!this.textarea.current){return}Util.textarea.moveCursor(this.textarea.current,newContent.length-postlude.length);});},this._addWidget=widgetType=>{const textarea=this.textarea.current;if(!textarea){return}this._addWidgetToContent(this.props.content,[textarea.selectionStart,textarea.selectionEnd],widgetType);textarea.focus();},this.addTemplate=e=>{const templateType=e.currentTarget.value;if(templateType===""){return}e.currentTarget.value="";let oldContent=this.props.content;oldContent=oldContent.replace(/\n*$/,"\n\n");let template;if(templateType==="table"){template="header 1 | header 2 | header 3\n"+"- | - | -\n"+"data 1 | data 2 | data 3\n"+"data 4 | data 5 | data 6\n"+"data 7 | data 8 | data 9";}else if(templateType==="titledTable"){template="|| **Table title** ||\n"+"header 1 | header 2 | header 3\n"+"- | - | -\n"+"data 1 | data 2 | data 3\n"+"data 4 | data 5 | data 6\n"+"data 7 | data 8 | data 9";}else if(templateType==="alignment"){template="$\\begin{align} \n"+"\\\\\\\\\n"+"\\end{align}$";}else if(templateType==="piecewise"){template="$f(x) = \\begin{cases}\n"+"7 & \\text{if }x=1 \\\\\n"+"f(x-1)+5 & \\text{if }x > 1\n"+"\\end{cases}$";}else if(templateType==="allWidgets"){template=Widgets.getAllWidgetTypes().map(type=>`[[${Util.snowman} ${type} 1]]`).join("\n\n");}else {throw new PerseusError("Invalid template type: "+templateType,Errors.InvalidInput,{metadata:{templateType}})}const newContent=oldContent+template;this.lastUserValue=this.props.content;this.props.onChange({content:newContent},this.focusAndMoveToEnd);},this.getSaveWarnings=()=>{const widgetIds=_.intersection(this.widgetIds,_.keys(this.refs));const warnings=_(widgetIds).chain().map(id=>{const issuesFunc=this.refs[id].getSaveWarnings;const issues=issuesFunc?issuesFunc():[];return _.map(issues,issue=>id+": "+issue)}).flatten(true).value();return warnings},this.focus=()=>{const textarea=this.textarea.current;if(textarea){textarea.focus();}},this.focusAndMoveToEnd=()=>{this.focus();const textarea=this.textarea.current;if(textarea){textarea.selectionStart=textarea.value.length;textarea.selectionEnd=textarea.value.length;}},this.serialize=options=>{const widgets={};const widgetIds=_.intersection(this.widgetIds,_.keys(this.refs));_.each(widgetIds,id=>{widgets[id]=this.refs[id].serialize();});if(options&&options.keepDeletedWidgets){_.chain(this.props.widgets).keys().reject(id=>_.contains(widgetIds,id)).each(id=>{widgets[id]=this.props.widgets[id];});}return {replace:this.props.replace,content:this.props.content,images:this.props.images,widgets:widgets}};}}Editor.defaultProps={content:"",placeholder:"",widgets:{},images:{},disabled:false,widgetEnabled:true,immutableWidgets:false,showWordCount:false,warnNoPrompt:false,warnNoWidgets:false};
|
|
1429
|
+
const widgetPlaceholder="[[☃ {id}]]";const widgetRegExp="(\\[\\[☃ {id}\\]\\])";const rWidgetSplit=new RegExp(widgetRegExp.replace("{id}","[a-z-]+ [0-9]+"),"g");const shortcutRegexp=/^\[\[([a-z-]+)$/;const ENDS_WITH_A_PARAGRAPH=/(?:\n{2,}|^\n*)$/;const TRAILING_NEWLINES=/(\n*)$/;const LEADING_NEWLINES=/^(\n*)/;const commafyInteger=n=>{let str=n.toString();if(str.length>=5){str=str.replace(/(\d)(?=(\d{3})+$)/g,"$1{,}");}return str};const makeEndWithAParagraphIfNecessary=content=>{if(!ENDS_WITH_A_PARAGRAPH.test(content)){const match=TRAILING_NEWLINES.exec(content);if(match){const newlines=match[1];return content+"\n\n".slice(0,2-newlines.length)}}return content};const makeStartWithAParagraphAlways=content=>{const match=LEADING_NEWLINES.exec(content);if(!match){return content}const newlines=match[1];return "\n\n".slice(0,2-newlines.length)+content};const IMAGE_REGEX$1=/!\[[^\]]*\]\(([^\s)]+)[^)]*\)/g;const allMatches=function(regex,str){const result=[];while(true){const match=regex.exec(str);if(!match){break}result.push(match);}return result};const imageUrlsFromContent=function(content){return allMatches(IMAGE_REGEX$1,content).map(capture=>capture[1])};class Editor extends React.Component{componentDidMount(){this.lastUserValue=null;this._sizeImages(this.props);$(this.textarea.current).on("copy cut",this._maybeCopyWidgets).on("paste",this._maybePasteWidgets);}UNSAFE_componentWillReceiveProps(nextProps){if(this.props.content!==nextProps.content){this.setState({textAreaValue:nextProps.content});}}componentDidUpdate(prevProps){const textarea=this.textarea.current;if(this.lastUserValue!=null&&textarea){textarea.focus();textarea.value=this.lastUserValue;textarea.selectionStart=0;textarea.setSelectionRange(0,prevProps.content.length);if(document.execCommand("insertText",false,this.props.content)===false){textarea.value=this.props.content;}this.lastUserValue=null;}if(this.props.content!==prevProps.content){this._sizeImages(this.props);}}componentWillUnmount(){clearTimeout(this.deferredChange);}getWidgetEditor(id,type){if(!Widgets.getEditor(type)){return}return createElement(WidgetEditor,{...this.props.widgets[id],ref:id,id:id,key:id,onChange:this._handleWidgetEditorChange.bind(this,id),onRemove:this._handleWidgetEditorRemove.bind(this,id),apiOptions:this.props.apiOptions,widgetIsOpen:this.props.widgetIsOpen})}render(){let pieces;let widgets;let underlayPieces;let widgetsDropDown;let templatesDropDown;let widgetsAndTemplates;let wordCountDisplay;const katexErrorList=[];if(this.props.showWordCount){const numChars=PerseusMarkdown.characterCount(this.props.content);const numWords=Math.floor(numChars/6);wordCountDisplay=jsxRuntimeExports.jsx("span",{className:"perseus-editor-word-count",title:"~"+commafyInteger(numWords)+" words ("+commafyInteger(numChars)+" characters)",children:commafyInteger(numWords)});}if(this.props.widgetEnabled){pieces=Util.split(this.props.content,rWidgetSplit);widgets={};underlayPieces=[];for(let i=0;i<pieces.length;i++){if(i%2===0){underlayPieces.push(pieces[i]);const ast=PerseusMarkdown.parse(pieces[i]);PerseusMarkdown.traverseContent(ast,node=>{if(node.type==="math"||node.type==="blockMath"){const content=preprocessTex(node.content);try{katex.renderToString(content,{colorIsTextColor:true});}catch(e){katexErrorList.push({math:content,message:e.message});}}});}else {const match=Util.rWidgetParts.exec(pieces[i]);if(match!=null){const id=match[1];const type=match[2];const duplicate=id in widgets;widgets[id]=this.getWidgetEditor(id,type);const classes=(duplicate||!widgets[id]?"error ":"")+("");const key=duplicate?i:id;underlayPieces.push(jsxRuntimeExports.jsx("b",{className:classes,children:pieces[i]},key));}}}this.widgetIds=_.keys(widgets);widgetsDropDown=jsxRuntimeExports.jsx(WidgetSelect,{onChange:this._addWidget});const insertTemplateString="Insert template…";templatesDropDown=jsxRuntimeExports.jsxs("select",{onChange:this.addTemplate,children:[jsxRuntimeExports.jsx("option",{value:"",children:insertTemplateString}),jsxRuntimeExports.jsx("option",{disabled:true,children:"--"}),jsxRuntimeExports.jsx("option",{value:"table",children:"Table"}),jsxRuntimeExports.jsx("option",{value:"titledTable",children:"Titled table"}),jsxRuntimeExports.jsx("option",{value:"alignment",children:"Aligned equations"}),jsxRuntimeExports.jsx("option",{value:"piecewise",children:"Piecewise function"}),jsxRuntimeExports.jsx("option",{disabled:true,children:"--"}),Object.entries(this.props.additionalTemplates).map(([key])=>jsxRuntimeExports.jsx("option",{value:key,children:key},key)),jsxRuntimeExports.jsx("option",{disabled:true,children:"--"}),jsxRuntimeExports.jsx("option",{value:"allWidgets",children:"All widgets (for testing)"})]});if(!this.props.immutableWidgets){const widgetNodes=Object.values(widgets);widgetsAndTemplates=jsxRuntimeExports.jsxs("div",{className:"perseus-editor-widgets",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-widgets-selectors",children:[widgetsDropDown,templatesDropDown,wordCountDisplay]}),widgetNodes]});wordCountDisplay=null;}}else {underlayPieces=[this.props.content];}underlayPieces.push(jsxRuntimeExports.jsx("br",{},"end"));const completeTextarea=[jsxRuntimeExports.jsx("div",{className:"perseus-textarea-underlay",ref:this.underlay,children:underlayPieces},"underlay"),jsxRuntimeExports.jsx("textarea",{ref:this.textarea,onChange:this.handleChange,onKeyDown:this._handleKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,value:this.state.textAreaValue},"textarea")];let textareaWrapper;if(this.props.imageUploader){textareaWrapper=jsxRuntimeExports.jsx(DragTarget,{onDrop:this.handleDrop,className:"perseus-textarea-pair",children:completeTextarea});}else {textareaWrapper=jsxRuntimeExports.jsx("div",{className:"perseus-textarea-pair",children:completeTextarea});}const contentWithoutWidgets=this.props.content.replace(/\[\[\u2603 (([a-z-]+) ([0-9]+))\]\]/g,"");const noPrompt=contentWithoutWidgets.trim().length===0;const noWidgets=!/\[\[\u2603 (([a-z-]+) ([0-9]+))\]\]/g.test(this.props.content);const warningStyle={borderTop:"none",padding:4,backgroundColor:"pink"};return jsxRuntimeExports.jsxs("div",{className:"perseus-single-editor "+(this.props.className||""),children:[textareaWrapper,katexErrorList.length>0&&jsxRuntimeExports.jsx(TexErrorView,{errorList:katexErrorList}),this.props.warnNoPrompt&&noPrompt&&jsxRuntimeExports.jsx("div",{style:warningStyle,children:"Graded Groups should contain a prompt"}),this.props.warnNoWidgets&&noWidgets&&jsxRuntimeExports.jsx("div",{style:warningStyle,children:"Graded Groups should contain at least one widget"}),wordCountDisplay,widgetsAndTemplates]})}constructor(...args){super(...args),this.underlay=React.createRef(),this.textarea=React.createRef(),this.state={textAreaValue:this.props.content},this._handleWidgetEditorChange=(id,newWidgetInfo,cb,silent)=>{const widgets=Object.assign({},this.props.widgets);widgets[id]=Object.assign({},widgets[id],newWidgetInfo);this.props.onChange({widgets},cb,silent);},this._handleWidgetEditorRemove=id=>{if(!confirm("Are you sure you want to delete this item?")){return}const textarea=this.textarea.current;const re=new RegExp(widgetRegExp.replace("{id}",id),"gm");this.props.onChange({content:textarea?.value.replace(re,"")});},this._sizeImages=props=>{const imageUrls=imageUrlsFromContent(props.content);const images=_.pick(props.images,imageUrls);const newImageUrls=_.filter(imageUrls,url=>!images[url]);_.each(newImageUrls,url=>{Util.getImageSize(url,(width,height)=>{images[url]={width:width,height:height};props.onChange({images:_.clone(images)},null,true);});});},this.handleDrop=e=>{const{imageUploader}=this.props;let content=this.state.textAreaValue||"";const dataTransfer=e.dataTransfer;if(!dataTransfer||!imageUploader){return}const files=dataTransfer.files;if(files.length===0){const imageUrl=dataTransfer.getData("URL");if(imageUrl){const newContent=content+"\n\n";this.lastUserValue=this.props.content;this.props.onChange({content:newContent});}return}const origContent=this.state.textAreaValue;_(files).chain().map(function(file){if(!file.type.match("image.*")){return null}const sentinel="☃ "+_.uniqueId("image_");content+="\n\n";return {file:file,sentinel:sentinel}}).reject(_.isNull).tap(()=>{this.lastUserValue=origContent;this.props.onChange({content:content});}).each(fileAndSentinel=>{imageUploader(fileAndSentinel.file,url=>{this.lastUserValue=origContent;this.props.onChange({content:this.state.textAreaValue.replace(fileAndSentinel.sentinel,url)});});});},this.handleChange=e=>{clearTimeout(this.deferredChange);this.setState({textAreaValue:e.currentTarget.value});this.deferredChange=setTimeout(()=>{if(this.state.textAreaValue!==this.props.content){this.props.onChange({content:this.state.textAreaValue});}},this.props.apiOptions.editorChangeDelay);},this._handleKeyDown=e=>{e.stopPropagation();if(e.key==="Tab"){const textarea=this.textarea.current;const word=Util.textarea.getWordBeforeCursor(textarea);const matches=word.string.toLowerCase().match(shortcutRegexp);if(matches!=null){const text=matches[1];const widgets=Widgets.getAllWidgetTypes();const matchingWidgets=widgets.filter(name=>{return name.substring(0,text.length)===text});if(matchingWidgets.length===1){const widgetType=matchingWidgets[0];this._addWidgetToContent(this.props.content,[word.pos.start,word.pos.end+1],widgetType);}e.preventDefault();}}},this._maybeCopyWidgets=e=>{const textarea=e.currentTarget;const selectedText=textarea.value.substring(textarea.selectionStart,textarea.selectionEnd);const widgetNames=_.map(selectedText.match(rWidgetSplit),syntax=>{return Util.rWidgetParts.exec(syntax)[1]});const widgetData=_.pick(this.serialize().widgets,widgetNames);localStorage.perseusLastCopiedText=selectedText;localStorage.perseusLastCopiedWidgets=JSON.stringify(widgetData);Log.log(`Widgets copied: ${localStorage.perseusLastCopiedWidgets}`);},this._maybePasteWidgets=e=>{const widgetJSON=localStorage.perseusLastCopiedWidgets;const lastCopiedText=localStorage.perseusLastCopiedText;const textToBePasted=e.originalEvent.clipboardData.getData("text");if(widgetJSON&&lastCopiedText===textToBePasted){e.preventDefault();const widgetData=JSON.parse(widgetJSON);const safeWidgetMapping=this._safeWidgetNameMapping(widgetData);const safeWidgetData={};for(const[key,data]of Object.entries(widgetData)){safeWidgetData[safeWidgetMapping[key]]=data;}const newWidgets=_.extend(safeWidgetData,this.props.widgets);const safeText=lastCopiedText.replace(rWidgetSplit,syntax=>{const match=Util.rWidgetParts.exec(syntax);const completeWidget=match[0];const widget=match[1];return completeWidget.replace(widget,safeWidgetMapping[widget])});const textarea=e.currentTarget;const selectionStart=textarea.selectionStart;const newContent=this.state.textAreaValue.substr(0,selectionStart)+safeText+this.state.textAreaValue.substr(textarea.selectionEnd);this.lastUserValue=this.state.textAreaValue;this.props.onChange({content:newContent,widgets:newWidgets},()=>{const expectedCursorPosition=selectionStart+safeText.length;Util.textarea.moveCursor(textarea,expectedCursorPosition);});}},this._safeWidgetNameMapping=widgetData=>{const widgets=_.keys(widgetData).map(name=>name.split(" "));const widgetTypes=_.uniq(widgets.map(widget=>widget[0]));const existingWidgets=_.keys(this.props.widgets).map(name=>name.split(" "));const safeWidgetNums={};_.each(widgetTypes,type=>{safeWidgetNums[type]=_.chain(existingWidgets).filter(existingWidget=>existingWidget[0]===type).map(existingWidget=>+existingWidget[1]+1).max().value();safeWidgetNums[type]=Math.max(safeWidgetNums[type],1);});const safeWidgetMapping={};_.each(widgets,widget=>{const widgetName=widget.join(" ");const widgetType=widget[0];safeWidgetMapping[widgetName]=`${widgetType} ${safeWidgetNums[widgetType]}`;safeWidgetNums[widgetType]++;});return safeWidgetMapping},this._addWidgetToContent=(oldContent,cursorRange,widgetType)=>{const allWidgetIds=_.map(oldContent.match(rWidgetSplit),syntax=>{const match=Util.rWidgetParts.exec(syntax);const type=match[2];const num=+match[3];return [type,num]});const widgetNum=_.reduce(allWidgetIds,(currentNum,otherId)=>{const[otherType,otherNum]=otherId;if(otherType===widgetType){return Math.max(otherNum+1,currentNum)}return currentNum},1);const id=widgetType+" "+widgetNum;const widgetContent=widgetPlaceholder.replace("{id}",id);const isBlock=CoreWidgetRegistry.getDefaultAlignment(widgetType)==="block";const prelude=oldContent.slice(0,cursorRange[0]);const postlude=oldContent.slice(cursorRange[1]);const newPrelude=isBlock?makeEndWithAParagraphIfNecessary(prelude):prelude;const newPostlude=isBlock?makeStartWithAParagraphAlways(postlude):postlude;const newContent=newPrelude+widgetContent+newPostlude;const newWidgets={...this.props.widgets};newWidgets[id]={options:Widgets.getEditor(widgetType)?.defaultProps,type:widgetType,version:Widgets.getVersion(widgetType)};this.lastUserValue=this.props.content;this.props.onChange({content:newContent,widgets:newWidgets},()=>{if(!this.textarea.current){return}Util.textarea.moveCursor(this.textarea.current,newContent.length-postlude.length);});},this._addWidget=widgetType=>{const textarea=this.textarea.current;if(!textarea){return}this._addWidgetToContent(this.props.content,[textarea.selectionStart,textarea.selectionEnd],widgetType);textarea.focus();},this.addTemplate=e=>{const templateType=e.currentTarget.value;if(templateType===""){return}e.currentTarget.value="";let oldContent=this.props.content;oldContent=oldContent.replace(/\n*$/,"\n\n");let template;if(templateType==="table"){template="header 1 | header 2 | header 3\n"+"- | - | -\n"+"data 1 | data 2 | data 3\n"+"data 4 | data 5 | data 6\n"+"data 7 | data 8 | data 9";}else if(templateType==="titledTable"){template="|| **Table title** ||\n"+"header 1 | header 2 | header 3\n"+"- | - | -\n"+"data 1 | data 2 | data 3\n"+"data 4 | data 5 | data 6\n"+"data 7 | data 8 | data 9";}else if(templateType==="alignment"){template="$\\begin{align} \n"+"\\\\\\\\\n"+"\\end{align}$";}else if(templateType==="piecewise"){template="$f(x) = \\begin{cases}\n"+"7 & \\text{if }x=1 \\\\\n"+"f(x-1)+5 & \\text{if }x > 1\n"+"\\end{cases}$";}else if(templateType==="allWidgets"){template=Widgets.getAllWidgetTypes().map(type=>`[[${Util.snowman} ${type} 1]]`).join("\n\n");}if(templateType in this.props.additionalTemplates){template=this.props.additionalTemplates[templateType];}else {throw new PerseusError("Invalid template type: "+templateType,Errors.InvalidInput,{metadata:{templateType}})}const newContent=oldContent+template;this.lastUserValue=this.props.content;this.props.onChange({content:newContent},this.focusAndMoveToEnd);},this.getSaveWarnings=()=>{const widgetIds=_.intersection(this.widgetIds,_.keys(this.refs));const warnings=_(widgetIds).chain().map(id=>{const issuesFunc=this.refs[id].getSaveWarnings;const issues=issuesFunc?issuesFunc():[];return _.map(issues,issue=>id+": "+issue)}).flatten(true).value();return warnings},this.focus=()=>{const textarea=this.textarea.current;if(textarea){textarea.focus();}},this.focusAndMoveToEnd=()=>{this.focus();const textarea=this.textarea.current;if(textarea){textarea.selectionStart=textarea.value.length;textarea.selectionEnd=textarea.value.length;}},this.serialize=options=>{const widgets={};const widgetIds=_.intersection(this.widgetIds,_.keys(this.refs));_.each(widgetIds,id=>{widgets[id]=this.refs[id].serialize();});if(options&&options.keepDeletedWidgets){_.chain(this.props.widgets).keys().reject(id=>_.contains(widgetIds,id)).each(id=>{widgets[id]=this.props.widgets[id];});}return {replace:this.props.replace,content:this.props.content,images:this.props.images,widgets:widgets}};}}Editor.defaultProps={content:"",placeholder:"",widgets:{},images:{},disabled:false,widgetEnabled:true,immutableWidgets:false,showWordCount:false,warnNoPrompt:false,warnNoWidgets:false,additionalTemplates:{}};
|
|
1430
1430
|
|
|
1431
1431
|
let nextIframeID=0;const requestIframeData={};const updateIframeHeight={};window.iframeDataStore={};window.addEventListener("message",event=>{if(typeof event.data==="string"){const callback=requestIframeData[event.data];if(callback){callback();}}else if(event.data.id){if(event.data.height!==undefined){updateIframeHeight[event.data.id](event.data.height);}else if(event.data.lintWarnings){Log.log("LINTER REPORT",{lintWarnings:JSON.stringify(event.data.lintWarnings)});}}});class IframeContentRenderer extends React.Component{componentDidMount(){this._isMounted=true;this.iframeID=nextIframeID;nextIframeID++;this._prepareFrame();requestIframeData[this.iframeID]=()=>{this.sendNewData(this._lastData);};updateIframeHeight[this.iframeID]=height=>{this._lastHeight=height;if(this._isMounted&&this.props.seamless&&this.container.current){this.container.current.style.height=height+"px";}};}shouldComponentUpdate(nextProps){return nextProps.datasetValue!==this.props.datasetValue||nextProps.seamless!==this.props.seamless}componentDidUpdate(prevProps){if(this.container.current){if(!this.props.seamless){this.container.current.style.height="100%";}else {this.container.current.style.height=this._lastHeight+"px";}}if(prevProps.datasetValue!==this.props.datasetValue){this._prepareFrame();}}componentWillUnmount(){requestIframeData[this.iframeID]=null;updateIframeHeight[this.iframeID]=null;this._isMounted=false;}_prepareFrame(){if(this._frame){this.container.current?.removeChild(this._frame);}const frame=document.createElement("iframe");frame.style.width="100%";frame.style.height="100%";frame.src=this.props.url;if(this.props.datasetKey){frame.dataset[this.props.datasetKey]=this.props.datasetValue;}frame.dataset.id=String(this.iframeID);if(this.props.seamless){frame.dataset.lintGutter="true";}this.container.current?.appendChild(frame);this._frame=frame;}sendNewData(data){const frame=this._frame;if(this._isMounted&&data&&frame?.contentWindow){this._lastData=data;window.iframeDataStore[this.iframeID]=data;frame.contentWindow.postMessage(this.iframeID,"*");}}render(){return jsxRuntimeExports.jsx("div",{ref:this.container,style:{width:"100%",height:"100%"}})}constructor(...args){super(...args),this.container=React.createRef();}}
|
|
1432
1432
|
|
|
@@ -1466,9 +1466,9 @@ const{InfoTip: InfoTip$o}=components;class ItemExtrasEditor extends React.Compon
|
|
|
1466
1466
|
|
|
1467
1467
|
const WARNINGS={inaccessibleWidget:(widgetType,widgetId)=>({id:`${widgetId} inaccessible`,description:`This ${widgetType} widget (${widgetId}) is inaccessible. Consider using an alternative to support all learners. Please check out the following documentation on compliant widget options.`,helpUrl:"https://khanacademy.atlassian.net/wiki/spaces/LC/pages/1909489691/Widget+Fundamentals",help:"Widget Fundamentals",impact:"medium",message:"Selecting inaccessible widgets for a practice item will result in this exercise being hidden from users with 'Hide visually dependant content' setting set to true. Please select another widget or create an alternative practice item."}),genericLinterWarning:(rule,message)=>({id:rule,description:message,help:"Learn more about best practices for authoring items",helpUrl:"https://docs.google.com/document/d/1N13f4sY-7EXWDwQ04ivA9vJBVvPPd60qjBT73B4NHuM/edit?tab=t.0",impact:"low",message:message})};
|
|
1468
1468
|
|
|
1469
|
-
class ItemEditor extends React.Component{static getDerivedStateFromProps(props){if(props.question?.content===ItemEditor.prevContent&&props.question?.widgets===ItemEditor.prevWidgets){return null}ItemEditor.prevContent=props.question?.content;ItemEditor.prevWidgets=props.question?.widgets;const parsed=PerseusMarkdown.parse(props.question?.content??"",{});const linterContext={content:props.question?.content,widgets:props.question?.widgets,stack:[]};return {issues:[...props.issues??[],...PerseusLinter.runLinter(parsed,linterContext,false)?.map(linterWarning=>{if(linterWarning.rule==="inaccessible-widget"){return WARNINGS.inaccessibleWidget(linterWarning.metadata?.widgetType??"unknown",linterWarning.metadata?.widgetId??"unknown")}return WARNINGS.genericLinterWarning(linterWarning.rule,linterWarning.message)})??[]]}}render(){const isMobile=this.props.deviceType==="phone"||this.props.deviceType==="tablet";return jsxRuntimeExports.jsxs("div",{className:"perseus-editor-table",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-row perseus-question-container",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-left-cell",children:[jsxRuntimeExports.jsx(IssuesPanel,{issues:this.state.issues}),jsxRuntimeExports.jsx("div",{className:"pod-title",children:"Question"}),jsxRuntimeExports.jsx(Editor,{ref:this.questionEditor,placeholder:"Type your question here...",className:"perseus-question-editor",imageUploader:this.props.imageUploader,onChange:this.handleEditorChange,apiOptions:this.props.apiOptions,showWordCount:true,widgetIsOpen:this.props.widgetIsOpen,...this.props.question},this.props.itemId)]}),jsxRuntimeExports.jsx("div",{className:"perseus-editor-right-cell",children:jsxRuntimeExports.jsxs("div",{id:"problemarea",children:[jsxRuntimeExports.jsx(DeviceFramer,{deviceType:this.props.deviceType,nochrome:true,children:jsxRuntimeExports.jsx(IframeContentRenderer,{ref:this.frame,datasetKey:"mobile",datasetValue:isMobile,seamless:true,url:this.props.previewURL},this.props.deviceType)}),jsxRuntimeExports.jsx("div",{id:"hintsarea",className:"hintsarea",style:{display:"none"}})]})})]}),jsxRuntimeExports.jsxs("div",{className:"perseus-editor-row perseus-answer-container",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-left-cell",children:[jsxRuntimeExports.jsx("div",{className:"pod-title",children:"Question extras"}),jsxRuntimeExports.jsx(ItemExtrasEditor,{ref:this.itemExtrasEditor,onChange:this.handleItemExtrasChange,...this.props.answerArea})]}),jsxRuntimeExports.jsx("div",{className:"perseus-editor-right-cell"})]})]})}constructor(...args){super(...args),this.frame=React.createRef(),this.questionEditor=React.createRef(),this.itemExtrasEditor=React.createRef(),this.state={issues:[]},this.updateProps=(newProps,cb,silent)=>{const props=_(this.props).pick("question","answerArea");this.props.onChange(_(props).extend(newProps),cb,silent);},this.triggerPreviewUpdate=newData=>{this.frame.current?.sendNewData(newData);},this.handleEditorChange=(newProps,cb,silent)=>{const question=_.extend({},this.props.question,newProps);this.updateProps({question},cb,silent);},this.handleItemExtrasChange=newProps=>{const answerArea=_.extend({},this.props.answerArea,newProps);this.updateProps({answerArea},()=>{},true);},this.getSaveWarnings=()=>{return this.questionEditor.current?.getSaveWarnings()},this.serialize=options=>{return {question:this.questionEditor.current?.serialize(options),answerArea:this.itemExtrasEditor.current?.serialize()}};}}ItemEditor.defaultProps={onChange:()=>{},question:{},answerArea:{}};
|
|
1469
|
+
class ItemEditor extends React.Component{static getDerivedStateFromProps(props){if(props.question?.content===ItemEditor.prevContent&&props.question?.widgets===ItemEditor.prevWidgets){return null}ItemEditor.prevContent=props.question?.content;ItemEditor.prevWidgets=props.question?.widgets;const parsed=PerseusMarkdown.parse(props.question?.content??"",{});const linterContext={content:props.question?.content,widgets:props.question?.widgets,stack:[]};return {issues:[...props.issues??[],...PerseusLinter.runLinter(parsed,linterContext,false)?.map(linterWarning=>{if(linterWarning.rule==="inaccessible-widget"){return WARNINGS.inaccessibleWidget(linterWarning.metadata?.widgetType??"unknown",linterWarning.metadata?.widgetId??"unknown")}return WARNINGS.genericLinterWarning(linterWarning.rule,linterWarning.message)})??[]]}}render(){const isMobile=this.props.deviceType==="phone"||this.props.deviceType==="tablet";return jsxRuntimeExports.jsxs("div",{className:"perseus-editor-table",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-row perseus-question-container",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-left-cell",children:[jsxRuntimeExports.jsx(IssuesPanel,{issues:this.state.issues}),jsxRuntimeExports.jsx("div",{className:"pod-title",children:"Question"}),jsxRuntimeExports.jsx(Editor,{ref:this.questionEditor,placeholder:"Type your question here...",className:"perseus-question-editor",imageUploader:this.props.imageUploader,onChange:this.handleEditorChange,apiOptions:this.props.apiOptions,showWordCount:true,widgetIsOpen:this.props.widgetIsOpen,additionalTemplates:this.props.additionalTemplates,...this.props.question},this.props.itemId)]}),jsxRuntimeExports.jsx("div",{className:"perseus-editor-right-cell",children:jsxRuntimeExports.jsxs("div",{id:"problemarea",children:[jsxRuntimeExports.jsx(DeviceFramer,{deviceType:this.props.deviceType,nochrome:true,children:jsxRuntimeExports.jsx(IframeContentRenderer,{ref:this.frame,datasetKey:"mobile",datasetValue:isMobile,seamless:true,url:this.props.previewURL},this.props.deviceType)}),jsxRuntimeExports.jsx("div",{id:"hintsarea",className:"hintsarea",style:{display:"none"}})]})})]}),jsxRuntimeExports.jsxs("div",{className:"perseus-editor-row perseus-answer-container",children:[jsxRuntimeExports.jsxs("div",{className:"perseus-editor-left-cell",children:[jsxRuntimeExports.jsx("div",{className:"pod-title",children:"Question extras"}),jsxRuntimeExports.jsx(ItemExtrasEditor,{ref:this.itemExtrasEditor,onChange:this.handleItemExtrasChange,...this.props.answerArea})]}),jsxRuntimeExports.jsx("div",{className:"perseus-editor-right-cell"})]})]})}constructor(...args){super(...args),this.frame=React.createRef(),this.questionEditor=React.createRef(),this.itemExtrasEditor=React.createRef(),this.state={issues:[]},this.updateProps=(newProps,cb,silent)=>{const props=_(this.props).pick("question","answerArea");this.props.onChange(_(props).extend(newProps),cb,silent);},this.triggerPreviewUpdate=newData=>{this.frame.current?.sendNewData(newData);},this.handleEditorChange=(newProps,cb,silent)=>{const question=_.extend({},this.props.question,newProps);this.updateProps({question},cb,silent);},this.handleItemExtrasChange=newProps=>{const answerArea=_.extend({},this.props.answerArea,newProps);this.updateProps({answerArea},()=>{},true);},this.getSaveWarnings=()=>{return this.questionEditor.current?.getSaveWarnings()},this.serialize=options=>{return {question:this.questionEditor.current?.serialize(options),answerArea:this.itemExtrasEditor.current?.serialize()}};}}ItemEditor.defaultProps={onChange:()=>{},question:{},answerArea:{}};
|
|
1470
1470
|
|
|
1471
|
-
const{HUD}=components;class EditorPage extends React.Component{componentDidMount(){this._isMounted=true;this.updateRenderer();}componentDidUpdate(){setTimeout(()=>{this.updateRenderer();});}componentWillUnmount(){this._isMounted=false;}updateRenderer(){const hasEditor=!this.props.developerMode||!this.props.jsonMode;if(!this._isMounted||!hasEditor){return}const touch=this.props.previewDevice==="phone"||this.props.previewDevice==="tablet";const deviceBasedApiOptions={...this.getApiOptions(),customKeypad:touch,isMobile:touch};this.itemEditor.current?.triggerPreviewUpdate({type:"question",data:_({item:this.serialize(),apiOptions:deviceBasedApiOptions,initialHintsVisible:0,device:this.props.previewDevice,linterContext:{contentType:"exercise",highlightLint:this.state.highlightLint,paths:this.props.contentPaths||[]},reviewMode:true,legacyPerseusLint:this.itemEditor.current?.getSaveWarnings()}).extend(_(this.props).pick("problemNum"))});}getApiOptions(){return {...ApiOptions.defaults,...this.props.apiOptions}}getSaveWarnings(){const issues1=this.itemEditor.current?.getSaveWarnings();const issues2=this.hintsEditor.current?.getSaveWarnings();return issues1.concat(issues2)}serialize(options){if(this.props.jsonMode){return this.state.json}return _.extend(this.itemEditor.current?.serialize(options),{hints:this.hintsEditor.current?.serialize(options)})}render(){let className="framework-perseus";const touch=this.props.previewDevice==="phone"||this.props.previewDevice==="tablet";const deviceBasedApiOptions={...this.getApiOptions(),customKeypad:touch,isMobile:touch};if(deviceBasedApiOptions.isMobile){className+=" "+ClassNames.MOBILE;}return jsxRuntimeExports.jsxs("div",{id:"perseus",className:className,children:[jsxRuntimeExports.jsxs("div",{style:{marginBottom:10},children:[this.props.developerMode&&jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsxs("label",{children:[" ","Developer JSON Mode:"," ",jsxRuntimeExports.jsx("input",{type:"checkbox",checked:this.props.jsonMode,onChange:this.toggleJsonMode})]})," "]}),!this.props.jsonMode&&jsxRuntimeExports.jsx(ViewportResizer,{deviceType:this.props.previewDevice,onViewportSizeChanged:this.props.onPreviewDeviceChange}),!this.props.jsonMode&&jsxRuntimeExports.jsx(HUD,{message:"Style warnings",enabled:this.state.highlightLint,onClick:()=>{this.setState({highlightLint:!this.state.highlightLint});}})]}),this.props.developerMode&&this.props.jsonMode&&jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(JsonEditor,{multiLine:true,value:this.state.json,onChange:this.changeJSON})}),(!this.props.developerMode||!this.props.jsonMode)&&jsxRuntimeExports.jsx(ItemEditor,{ref:this.itemEditor,itemId:this.props.itemId,question:this.props.question,answerArea:this.props.answerArea,imageUploader:this.props.imageUploader,onChange:this.handleChange,deviceType:this.props.previewDevice,widgetIsOpen:this.state.widgetsAreOpen,apiOptions:deviceBasedApiOptions,previewURL:this.props.previewURL,issues:this.props.issues}),(!this.props.developerMode||!this.props.jsonMode)&&jsxRuntimeExports.jsx(CombinedHintsEditor,{ref:this.hintsEditor,itemId:this.props.itemId,hints:this.props.hints,imageUploader:this.props.imageUploader,onChange:this.handleChange,deviceType:this.props.previewDevice,apiOptions:deviceBasedApiOptions,previewURL:this.props.previewURL,highlightLint:this.state.highlightLint,widgetIsOpen:this.state.widgetsAreOpen})]})}constructor(props){super(props),this.itemEditor=React.createRef(),this.hintsEditor=React.createRef(),this.toggleJsonMode=()=>{this.setState({json:this.serialize({keepDeletedWidgets:true})},()=>{this.props.onChange({jsonMode:!this.props.jsonMode});});},this.handleChange=(toChange,cb,silent)=>{const newProps=_(this.props).pick("question","hints","answerArea");_(newProps).extend(toChange);this.props.onChange(newProps,cb,silent);},this.changeJSON=newJson=>{this.setState({json:newJson});this.props.onChange(newJson);};this.state={json:_.pick(this.props,"question","answerArea","hints"),gradeMessage:"",wasAnswered:false,highlightLint:true,widgetsAreOpen:this.props.widgetsAreOpen??true};this._isMounted=false;}}EditorPage.defaultProps={developerMode:false,jsonMode:false,onChange:()=>{}};
|
|
1471
|
+
const{HUD}=components;class EditorPage extends React.Component{componentDidMount(){this._isMounted=true;this.updateRenderer();}componentDidUpdate(){setTimeout(()=>{this.updateRenderer();});}componentWillUnmount(){this._isMounted=false;}updateRenderer(){const hasEditor=!this.props.developerMode||!this.props.jsonMode;if(!this._isMounted||!hasEditor){return}const touch=this.props.previewDevice==="phone"||this.props.previewDevice==="tablet";const deviceBasedApiOptions={...this.getApiOptions(),customKeypad:touch,isMobile:touch};this.itemEditor.current?.triggerPreviewUpdate({type:"question",data:_({item:this.serialize(),apiOptions:deviceBasedApiOptions,initialHintsVisible:0,device:this.props.previewDevice,linterContext:{contentType:"exercise",highlightLint:this.state.highlightLint,paths:this.props.contentPaths||[]},reviewMode:true,legacyPerseusLint:this.itemEditor.current?.getSaveWarnings()}).extend(_(this.props).pick("problemNum"))});}getApiOptions(){return {...ApiOptions.defaults,...this.props.apiOptions}}getSaveWarnings(){const issues1=this.itemEditor.current?.getSaveWarnings();const issues2=this.hintsEditor.current?.getSaveWarnings();return issues1.concat(issues2)}serialize(options){if(this.props.jsonMode){return this.state.json}return _.extend(this.itemEditor.current?.serialize(options),{hints:this.hintsEditor.current?.serialize(options)})}render(){let className="framework-perseus";const touch=this.props.previewDevice==="phone"||this.props.previewDevice==="tablet";const deviceBasedApiOptions={...this.getApiOptions(),customKeypad:touch,isMobile:touch};if(deviceBasedApiOptions.isMobile){className+=" "+ClassNames.MOBILE;}return jsxRuntimeExports.jsxs("div",{id:"perseus",className:className,children:[jsxRuntimeExports.jsxs("div",{style:{marginBottom:10},children:[this.props.developerMode&&jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsxs("label",{children:[" ","Developer JSON Mode:"," ",jsxRuntimeExports.jsx("input",{type:"checkbox",checked:this.props.jsonMode,onChange:this.toggleJsonMode})]})," "]}),!this.props.jsonMode&&jsxRuntimeExports.jsx(ViewportResizer,{deviceType:this.props.previewDevice,onViewportSizeChanged:this.props.onPreviewDeviceChange}),!this.props.jsonMode&&jsxRuntimeExports.jsx(HUD,{message:"Style warnings",enabled:this.state.highlightLint,onClick:()=>{this.setState({highlightLint:!this.state.highlightLint});}})]}),this.props.developerMode&&this.props.jsonMode&&jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(JsonEditor,{multiLine:true,value:this.state.json,onChange:this.changeJSON})}),(!this.props.developerMode||!this.props.jsonMode)&&jsxRuntimeExports.jsx(ItemEditor,{ref:this.itemEditor,itemId:this.props.itemId,question:this.props.question,answerArea:this.props.answerArea,imageUploader:this.props.imageUploader,onChange:this.handleChange,deviceType:this.props.previewDevice,widgetIsOpen:this.state.widgetsAreOpen,apiOptions:deviceBasedApiOptions,previewURL:this.props.previewURL,issues:this.props.issues,additionalTemplates:this.props.additionalTemplates}),(!this.props.developerMode||!this.props.jsonMode)&&jsxRuntimeExports.jsx(CombinedHintsEditor,{ref:this.hintsEditor,itemId:this.props.itemId,hints:this.props.hints,imageUploader:this.props.imageUploader,onChange:this.handleChange,deviceType:this.props.previewDevice,apiOptions:deviceBasedApiOptions,previewURL:this.props.previewURL,highlightLint:this.state.highlightLint,widgetIsOpen:this.state.widgetsAreOpen})]})}constructor(props){super(props),this.itemEditor=React.createRef(),this.hintsEditor=React.createRef(),this.toggleJsonMode=()=>{this.setState({json:this.serialize({keepDeletedWidgets:true})},()=>{this.props.onChange({jsonMode:!this.props.jsonMode});});},this.handleChange=(toChange,cb,silent)=>{const newProps=_(this.props).pick("question","hints","answerArea");_(newProps).extend(toChange);this.props.onChange(newProps,cb,silent);},this.changeJSON=newJson=>{this.setState({json:newJson});this.props.onChange(newJson);};this.state={json:_.pick(this.props,"question","answerArea","hints"),gradeMessage:"",wasAnswered:false,highlightLint:true,widgetsAreOpen:this.props.widgetsAreOpen??true};this._isMounted=false;}}EditorPage.defaultProps={developerMode:false,jsonMode:false,onChange:()=>{}};
|
|
1472
1472
|
|
|
1473
1473
|
function ContentPreview({question,apiOptions,seamless,linterContext,legacyPerseusLint,previewDevice}){const i18n=usePerseusI18n();const isMobile=previewDevice!=="desktop";const className=isMobile?"perseus-mobile":"";return jsxRuntimeExports.jsx(View,{className:`framework-perseus ${className}`,style:[styles$O.container,!seamless?styles$O.gutter:undefined],children:jsxRuntimeExports.jsx(StatefulKeypadContextProvider,{children:jsxRuntimeExports.jsx(KeypadContext.Consumer,{children:({setKeypadActive,keypadElement,setKeypadElement})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Renderer,{strings:i18n.strings,apiOptions:{...apiOptions,isMobile},keypadElement:keypadElement,linterContext:linterContext,legacyPerseusLint:legacyPerseusLint,...question}),jsxRuntimeExports.jsx(MobileKeypad,{onAnalyticsEvent:()=>Promise.resolve(),onDismiss:()=>setKeypadActive(false),onElementMounted:setKeypadElement})]})})})})}const styles$O=StyleSheet.create({container:{padding:spacing.xxxSmall_4,containerType:"inline-size",containerName:"perseus-root"},gutter:{marginRight:lintGutterWidth}});
|
|
1474
1474
|
|
|
@@ -1683,7 +1683,7 @@ const{InfoTip: InfoTip$3,NumberInput: NumberInput$2,RangeInput,TextListEditor: T
|
|
|
1683
1683
|
|
|
1684
1684
|
const{NumberInput: NumberInput$1,TextInput}=components;function validateOptions(height,programID){const errors=[];if(programID===""){errors.push("The program ID is required.");}if(!Number.isInteger(height)||height<1){errors.push("The height must be a positive integer.");}return errors}class PythonProgramEditor extends React.Component{serialize(){return {programID:this.props.programID,height:this.props.height}}render(){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("label",{children:["User Program ID:"," ",jsxRuntimeExports.jsx(TextInput,{value:this.props.programID,onChange:this.change("programID"),placeholder:"123"})]}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("label",{children:["Height:"," ",jsxRuntimeExports.jsx(NumberInput$1,{value:this.props.height,onChange:this.change("height"),placeholder:"400"})]})]})}constructor(...args){super(...args),this.change=(...args)=>{return Changeable.change.apply(this,args)},this.getSaveWarnings=()=>{return validateOptions(this.props.height,this.props.programID)};}}PythonProgramEditor.widgetName="python-program";PythonProgramEditor.defaultProps=pythonProgramLogic.defaultWidgetOptions;
|
|
1685
1685
|
|
|
1686
|
-
class ChoiceEditor extends React.Component{render(){const checkedClass=this.props.choice.correct?"correct":"incorrect";let placeholder="Type a choice here...";if(this.props.choice.isNoneOfTheAbove){placeholder=this.props.choice.correct?"Type the answer to reveal to the user...":"None of the above";}const editor=jsxRuntimeExports.jsx(Editor,{ref:"content-editor",apiOptions:this.props.apiOptions,content:this.props.choice.content||"",widgetEnabled:false,placeholder:placeholder,disabled:this.props.choice.isNoneOfTheAbove&&!this.props.choice.correct,onChange:this.props.onContentChange});const
|
|
1686
|
+
class ChoiceEditor extends React.Component{render(){const checkedClass=this.props.choice.correct?"correct":"incorrect";let placeholder="Type a choice here...";if(this.props.choice.isNoneOfTheAbove){placeholder=this.props.choice.correct?"Type the answer to reveal to the user...":"None of the above";}const editor=jsxRuntimeExports.jsx(Editor,{ref:"content-editor",apiOptions:this.props.apiOptions,content:this.props.choice.content||"",widgetEnabled:false,placeholder:placeholder,disabled:this.props.choice.isNoneOfTheAbove&&!this.props.choice.correct,onChange:this.props.onContentChange});const rationaleEditor=jsxRuntimeExports.jsx(Editor,{ref:"rationale-editor",apiOptions:this.props.apiOptions,content:this.props.choice.rationale||"",widgetEnabled:false,placeholder:`Why is this choice ${checkedClass}?`,onChange:this.props.onRationaleChange});const deleteLink=jsxRuntimeExports.jsx("a",{className:"simple-button orange delete-choice",href:"#",onClick:e=>{e.stopPropagation();e.preventDefault();this.props.onDelete();},title:"Remove this choice",children:"Remove this choice"});return jsxRuntimeExports.jsxs("div",{className:"choice-rationale-editors",children:[jsxRuntimeExports.jsx("div",{className:`choice-editor ${checkedClass}`,children:editor}),jsxRuntimeExports.jsx("div",{className:"rationale-editor",children:rationaleEditor}),this.props.showDelete&&deleteLink]})}}class RadioEditor extends React.Component{onRationaleChange(choiceIndex,newRationale){const choices=this.props.choices.slice();choices[choiceIndex]=_.extend({},choices[choiceIndex],{rationale:newRationale});if(newRationale===""){delete choices[choiceIndex].rationale;}this.props.onChange({choices:choices});}serialize(){const{choices,randomize,multipleSelect,countChoices,hasNoneOfTheAbove,deselectEnabled}=this.props;return {choices,randomize,multipleSelect,countChoices,hasNoneOfTheAbove,deselectEnabled,numCorrect:deriveNumCorrect({...this.props,numCorrect:undefined})}}render(){const numCorrect=_.reduce(this.props.choices,function(memo,choice){return choice.correct?memo+1:memo},0);return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Link$1,{href:"https://www.khanacademy.org/internal-courses/content-creation-best-practices/xe46daa512cd9c644:question-writing/xe46daa512cd9c644:multiple-choice/a/stems",target:"_blank",children:"Multiple choice best practices"}),jsxRuntimeExports.jsxs("div",{className:"perseus-widget-row",children:[jsxRuntimeExports.jsx(LabeledSwitch,{label:"Randomize order",checked:this.props.randomize,onChange:value=>{this.props.onChange({randomize:value});},style:{marginBlockEnd:sizing.size_060}}),jsxRuntimeExports.jsx(LabeledSwitch,{label:"Multiple selections",checked:this.props.multipleSelect,onChange:value=>{this.onMultipleSelectChange({multipleSelect:value});},style:{marginBlockEnd:sizing.size_060}}),this.props.multipleSelect&&jsxRuntimeExports.jsx(LabeledSwitch,{label:"Specify number correct",checked:this.props.countChoices,onChange:value=>{this.onCountChoicesChange({countChoices:value});},style:{marginBlockEnd:sizing.size_060}})]}),jsxRuntimeExports.jsx(BaseRadio,{multipleSelect:this.props.multipleSelect,countChoices:this.props.countChoices,numCorrect:numCorrect,editMode:true,labelWrap:false,apiOptions:this.props.apiOptions,reviewMode:false,choices:this.props.choices.map((choice,i)=>{return {content:jsxRuntimeExports.jsx(ChoiceEditor,{ref:`choice-editor${i}`,apiOptions:this.props.apiOptions,choice:choice,onContentChange:newProps=>{if(newProps.content!=null){this.onContentChange(i,newProps.content);}},onRationaleChange:newProps=>{if(newProps.content!=null){this.onRationaleChange(i,newProps.content);}},onDelete:()=>this.onDelete(i),showDelete:this.props.choices.length>=2}),isNoneOfTheAbove:choice.isNoneOfTheAbove,checked:choice.correct}},this),onChange:this.onChange}),jsxRuntimeExports.jsxs("div",{className:"add-choice-container",children:[jsxRuntimeExports.jsx(Button,{size:"small",kind:"tertiary",startIcon:plusIcon,onClick:this.addChoice.bind(this,false),children:"Add a choice"}),jsxRuntimeExports.jsx(Strut,{size:spacing.large_24}),jsxRuntimeExports.jsx(Button,{size:"small",kind:"tertiary",startIcon:plusIcon,onClick:this.addChoice.bind(this,true),children:"None of the above"})]})]})}constructor(...args){super(...args),this.change=(...args)=>{return Changeable.change.apply(this,args)},this.onMultipleSelectChange=allowMultiple=>{allowMultiple=allowMultiple.multipleSelect;const numCorrect=_.reduce(this.props.choices,function(memo,choice){return choice.correct?memo+1:memo},0);if(!allowMultiple&&numCorrect>1){const choices=_.map(this.props.choices,function(choice){return _.defaults({correct:false},choice)});this.props.onChange({multipleSelect:allowMultiple,choices:choices});}else {this.props.onChange({multipleSelect:allowMultiple});}},this.onCountChoicesChange=count=>{count=count.countChoices;this.props.onChange({countChoices:count});},this.onChange=({checked})=>{const choices=this.props.choices.map((choice,i)=>{return {...choice,correct:checked[i],content:choice.isNoneOfTheAbove&&!checked[i]?"":choice.content}});this.props.onChange({choices:choices,numCorrect:deriveNumCorrect({...this.props,choices,numCorrect:undefined})});},this.onContentChange=(choiceIndex,newContent)=>{const choices=this.props.choices.slice();choices[choiceIndex]=_.extend({},choices[choiceIndex],{content:newContent});this.props.onChange({choices:choices});},this.onDelete=choiceIndex=>{const choices=this.props.choices.slice();const deleted=choices[choiceIndex];choices.splice(choiceIndex,1);this.props.onChange({choices:choices,hasNoneOfTheAbove:this.props.hasNoneOfTheAbove&&!deleted.isNoneOfTheAbove});},this.addChoice=(noneOfTheAbove,e)=>{e.preventDefault();const choices=this.props.choices.slice();const newChoice={isNoneOfTheAbove:noneOfTheAbove,content:""};const addIndex=choices.length-(this.props.hasNoneOfTheAbove?1:0);choices.splice(addIndex,0,newChoice);this.props.onChange({choices:choices,hasNoneOfTheAbove:noneOfTheAbove||this.props.hasNoneOfTheAbove},()=>{this.refs[`choice-editor${addIndex}`].refs["content-editor"].focus();});},this.focus=()=>{this.refs["choice-editor0"].refs["content-editor"].focus();return true},this.getSaveWarnings=()=>{if(!_.some(_.pluck(this.props.choices,"correct"))){return ["No choice is marked as correct."]}return []};}}RadioEditor.widgetName="radio";RadioEditor.defaultProps=radioLogic.defaultWidgetOptions;
|
|
1687
1687
|
|
|
1688
1688
|
const{InfoTip: InfoTip$2,TextListEditor}=components;const HORIZONTAL="horizontal";const VERTICAL="vertical";class SorterEditor extends React.Component{render(){const editor=this;return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{children:[" ","Correct answer:"," ",jsxRuntimeExports.jsx(InfoTip$2,{children:jsxRuntimeExports.jsx("p",{children:"Enter the correct answer (in the correct order) here. The preview on the right will have the cards in a randomized order, which is how the student will see them."})})]}),jsxRuntimeExports.jsx(TextListEditor,{options:this.props.correct,onChange:function(options,cb){editor.props.onChange({correct:options},cb);},layout:this.props.layout}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("label",{children:[" ","Layout:"," ",jsxRuntimeExports.jsxs("select",{value:this.props.layout,onChange:this.onLayoutChange,children:[jsxRuntimeExports.jsx("option",{value:HORIZONTAL,children:"Horizontal"}),jsxRuntimeExports.jsx("option",{value:VERTICAL,children:"Vertical"})]})]}),jsxRuntimeExports.jsx(InfoTip$2,{children:jsxRuntimeExports.jsx("p",{children:"Use the horizontal layout for short text and small images. The vertical layout is best for longer text and larger images."})})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Checkbox$1,{label:"Padding:",checked:this.props.padding,onChange:value=>{this.props.onChange({padding:value});}}),jsxRuntimeExports.jsx(InfoTip$2,{children:jsxRuntimeExports.jsx("p",{children:"Padding is good for text, but not needed for images."})})]})]})}constructor(...args){super(...args),this.onLayoutChange=e=>{this.props.onChange({layout:e.target.value});},this.serialize=()=>{return _.pick(this.props,"correct","layout","padding")};}}SorterEditor.propTypes={correct:PropTypes.array,layout:PropTypes.oneOf([HORIZONTAL,VERTICAL]),padding:PropTypes.bool};SorterEditor.widgetName="sorter";SorterEditor.defaultProps=sorterLogic.defaultWidgetOptions;
|
|
1689
1689
|
|