@khanacademy/perseus-editor 8.2.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/angle-input.d.ts +2 -2
- package/dist/components/coordinate-pair-input.d.ts +2 -2
- package/dist/components/graph-locked-figures/color-select.d.ts +2 -2
- package/dist/components/graph-locked-figures/color-swatch.d.ts +2 -2
- package/dist/components/graph-locked-figures/defining-point-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/ellipse-swatch.d.ts +2 -2
- package/dist/components/graph-locked-figures/labeled-row.d.ts +1 -1
- package/dist/components/graph-locked-figures/labeled-switch.d.ts +2 -2
- package/dist/components/graph-locked-figures/line-swatch.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-ellipse-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-figure-select.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-figure-settings-actions.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-figures-section.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-line-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-point-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-polygon-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-vector-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/polygon-swatch.d.ts +2 -2
- package/dist/components/graph-points-count-selector.d.ts +2 -2
- package/dist/components/graph-type-selector.d.ts +2 -2
- package/dist/components/heading.d.ts +2 -2
- package/dist/components/interactive-graph-correct-answer.d.ts +1 -1
- package/dist/components/interactive-graph-settings.d.ts +1 -1
- package/dist/components/perseus-editor-accordion.d.ts +1 -1
- package/dist/components/segment-count-selector.d.ts +2 -2
- package/dist/components/start-coord-settings.d.ts +2 -2
- package/dist/components/toggleable-caret.d.ts +2 -2
- package/dist/components/viewport-resizer.d.ts +2 -2
- package/dist/components/widget-editor.d.ts +1 -1
- package/dist/es/index.js +62 -172
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +61 -172
- package/dist/index.js.map +1 -1
- package/dist/widgets/image-editor.d.ts +2 -2
- package/dist/widgets/interaction-editor/mathquill-input.d.ts +2 -2
- package/dist/widgets/interactive-graph-editor.d.ts +129 -75
- package/dist/widgets/numeric-input-editor.d.ts +1 -1
- package/package.json +7 -7
- package/dist/stateful-article-editor.d.ts +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export { default as Editor } from "./editor";
|
|
|
10
10
|
export { default as i18n } from "./i18n";
|
|
11
11
|
export { default as IframeContentRenderer } from "./iframe-content-renderer";
|
|
12
12
|
export { default as MultiRendererEditor } from "./multirenderer-editor";
|
|
13
|
-
export { default as StatefulArticleEditor } from "./stateful-article-editor";
|
|
14
13
|
export { default as StatefulEditorPage } from "./stateful-editor-page";
|
|
15
14
|
import "./styles/perseus-editor.less";
|
|
16
15
|
import AllEditors from "./all-editors";
|
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
|
|
|
83
83
|
|
|
84
84
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
85
85
|
const libName = "@khanacademy/perseus-editor";
|
|
86
|
-
const libVersion = "
|
|
86
|
+
const libVersion = "10.0.0";
|
|
87
87
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
88
88
|
|
|
89
89
|
function _extends() {
|
|
@@ -278,13 +278,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
278
278
|
role: "button",
|
|
279
279
|
hideDefaultFocusRing: true,
|
|
280
280
|
"aria-label": title,
|
|
281
|
-
style: styles$
|
|
281
|
+
style: styles$G.button
|
|
282
282
|
}, _ref => {
|
|
283
283
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const styles$
|
|
287
|
+
const styles$G = aphrodite.StyleSheet.create({
|
|
288
288
|
button: {
|
|
289
289
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
290
290
|
margin: 2,
|
|
@@ -20789,13 +20789,13 @@ class WidgetSelect extends React__namespace.Component {
|
|
|
20789
20789
|
* that collapse a region.
|
|
20790
20790
|
*/
|
|
20791
20791
|
function ToggleableCaret(props) {
|
|
20792
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20792
|
+
const iconStyle = props.isExpanded ? styles$F.expanded : styles$F.collapsed;
|
|
20793
20793
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20794
20794
|
icon: caretRight__default["default"],
|
|
20795
20795
|
style: iconStyle
|
|
20796
20796
|
});
|
|
20797
20797
|
}
|
|
20798
|
-
const styles$
|
|
20798
|
+
const styles$F = aphrodite.StyleSheet.create({
|
|
20799
20799
|
collapsed: {
|
|
20800
20800
|
transition: ".15s"
|
|
20801
20801
|
},
|
|
@@ -20825,16 +20825,16 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20825
20825
|
showErrors
|
|
20826
20826
|
} = this.state;
|
|
20827
20827
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20828
|
-
style: styles$
|
|
20828
|
+
style: styles$E.errorContainer
|
|
20829
20829
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20830
|
-
style: styles$
|
|
20830
|
+
style: styles$E.title,
|
|
20831
20831
|
onClick: this.handleToggleTexErrors
|
|
20832
20832
|
}, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
20833
20833
|
isExpanded: showErrors
|
|
20834
20834
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20835
|
-
style: styles$
|
|
20835
|
+
style: styles$E.errorExplanation
|
|
20836
20836
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20837
|
-
style: styles$
|
|
20837
|
+
style: styles$E.error,
|
|
20838
20838
|
key: index
|
|
20839
20839
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20840
20840
|
style: {
|
|
@@ -20843,7 +20843,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20843
20843
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20844
20844
|
}
|
|
20845
20845
|
}
|
|
20846
|
-
const styles$
|
|
20846
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
20847
20847
|
title: {
|
|
20848
20848
|
backgroundColor: "#eee",
|
|
20849
20849
|
fontSize: "1.25em",
|
|
@@ -24593,12 +24593,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24593
24593
|
...otherProps
|
|
24594
24594
|
} = this.props;
|
|
24595
24595
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24596
|
-
className: aphrodite.css(styles$
|
|
24596
|
+
className: aphrodite.css(styles$D.baseButton, color === "green" && styles$D.green, color === "orange" && styles$D.orange),
|
|
24597
24597
|
onClick: onClick
|
|
24598
24598
|
}, otherProps), children);
|
|
24599
24599
|
}
|
|
24600
24600
|
}
|
|
24601
|
-
const styles$
|
|
24601
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
24602
24602
|
baseButton: {
|
|
24603
24603
|
top: "0",
|
|
24604
24604
|
fontSize: "11px",
|
|
@@ -24811,23 +24811,23 @@ const LeafContainer = _ref2 => {
|
|
|
24811
24811
|
} = _ref2;
|
|
24812
24812
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24813
24813
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24814
|
-
className: aphrodite.css(styles$
|
|
24814
|
+
className: aphrodite.css(styles$C.containerHeader)
|
|
24815
24815
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24816
24816
|
depth: path.length,
|
|
24817
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$C.containerTitle)
|
|
24818
24818
|
}, capitalize(name)));
|
|
24819
24819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24820
|
-
className: aphrodite.css(styles$
|
|
24820
|
+
className: aphrodite.css(styles$C.container)
|
|
24821
24821
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24822
|
-
className: aphrodite.css(styles$
|
|
24822
|
+
className: aphrodite.css(styles$C.row, styles$C.rowHeading)
|
|
24823
24823
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24824
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
24825
24825
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24826
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24826
|
+
className: "pod-title " + aphrodite.css(styles$C.containerHeader)
|
|
24827
24827
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24828
|
-
className: aphrodite.css(styles$
|
|
24828
|
+
className: aphrodite.css(styles$C.containerTitle)
|
|
24829
24829
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24830
|
-
className: aphrodite.css(styles$
|
|
24830
|
+
className: aphrodite.css(styles$C.columnRight)
|
|
24831
24831
|
}, previewHeading)), children);
|
|
24832
24832
|
};
|
|
24833
24833
|
const ArrayContainer = props => {
|
|
@@ -24840,11 +24840,11 @@ const ArrayContainer = props => {
|
|
|
24840
24840
|
actions
|
|
24841
24841
|
} = props;
|
|
24842
24842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24843
|
-
className: aphrodite.css(styles$
|
|
24843
|
+
className: aphrodite.css(styles$C.container)
|
|
24844
24844
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24845
|
-
className: aphrodite.css(styles$
|
|
24845
|
+
className: aphrodite.css(styles$C.columnLeft, styles$C.containerHeader)
|
|
24846
24846
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24847
|
-
className: aphrodite.css(styles$
|
|
24847
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
24848
24848
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24849
24849
|
href: "javascript:void 0",
|
|
24850
24850
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24858,28 +24858,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24858
24858
|
path
|
|
24859
24859
|
} = _ref3;
|
|
24860
24860
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24861
|
-
className: aphrodite.css(styles$
|
|
24861
|
+
className: aphrodite.css(styles$C.containerHeader)
|
|
24862
24862
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24863
24863
|
depth: path.length,
|
|
24864
|
-
className: aphrodite.css(styles$
|
|
24864
|
+
className: aphrodite.css(styles$C.containerTitle)
|
|
24865
24865
|
}, capitalize(name)), controls);
|
|
24866
24866
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24867
|
-
className: aphrodite.css(styles$
|
|
24867
|
+
className: aphrodite.css(styles$C.containerHeader, styles$C.previewCollectionHeader)
|
|
24868
24868
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24869
24869
|
depth: path.length,
|
|
24870
|
-
className: aphrodite.css(styles$
|
|
24870
|
+
className: aphrodite.css(styles$C.containerTitle)
|
|
24871
24871
|
}, capitalize(name)));
|
|
24872
24872
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24873
24873
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24874
|
-
className: aphrodite.css(styles$
|
|
24874
|
+
className: aphrodite.css(styles$C.container)
|
|
24875
24875
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24876
|
-
className: aphrodite.css(styles$
|
|
24876
|
+
className: aphrodite.css(styles$C.row)
|
|
24877
24877
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24878
|
-
className: aphrodite.css(styles$
|
|
24878
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
24879
24879
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24880
|
-
className: aphrodite.css(styles$
|
|
24880
|
+
className: aphrodite.css(styles$C.columnRight)
|
|
24881
24881
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24882
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24882
|
+
className: aphrodite.css(path.length > 0 && styles$C.contentIndent)
|
|
24883
24883
|
}, children));
|
|
24884
24884
|
};
|
|
24885
24885
|
|
|
@@ -24999,11 +24999,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24999
24999
|
className: "framework-perseus"
|
|
25000
25000
|
}, lens(renderers).get(path));
|
|
25001
25001
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$C.row)
|
|
25003
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
25005
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25006
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$C.sticky)
|
|
25007
25007
|
},
|
|
25008
25008
|
/*#__PURE__*/
|
|
25009
25009
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25011,9 +25011,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25011
25011
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25012
25012
|
apiOptions: apiOptions
|
|
25013
25013
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25014
|
-
className: aphrodite.css(styles$
|
|
25014
|
+
className: aphrodite.css(styles$C.columnRight)
|
|
25015
25015
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25016
|
-
className: aphrodite.css(sticky && styles$
|
|
25016
|
+
className: aphrodite.css(sticky && styles$C.sticky)
|
|
25017
25017
|
}, preview))));
|
|
25018
25018
|
});
|
|
25019
25019
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25029,13 +25029,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25029
25029
|
className: "framework-perseus"
|
|
25030
25030
|
}, lens(renderers).get(path));
|
|
25031
25031
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25032
|
-
className: aphrodite.css(styles$
|
|
25032
|
+
className: aphrodite.css(styles$C.row)
|
|
25033
25033
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25034
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
25035
25035
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25036
|
-
className: aphrodite.css(sticky && styles$
|
|
25036
|
+
className: aphrodite.css(sticky && styles$C.sticky)
|
|
25037
25037
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25038
|
-
className: aphrodite.css(styles$
|
|
25038
|
+
className: aphrodite.css(styles$C.hintEditor),
|
|
25039
25039
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25040
25040
|
apiOptions: apiOptions,
|
|
25041
25041
|
showTitle: false,
|
|
@@ -25050,9 +25050,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25050
25050
|
isFirst: true,
|
|
25051
25051
|
isLast: true
|
|
25052
25052
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: aphrodite.css(styles$
|
|
25053
|
+
className: aphrodite.css(styles$C.columnRight)
|
|
25054
25054
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25055
|
-
className: aphrodite.css(sticky && styles$
|
|
25055
|
+
className: aphrodite.css(sticky && styles$C.sticky)
|
|
25056
25056
|
}, preview)));
|
|
25057
25057
|
});
|
|
25058
25058
|
const TagsNodeContent = props => {
|
|
@@ -25069,9 +25069,9 @@ const TagsNodeContent = props => {
|
|
|
25069
25069
|
return null;
|
|
25070
25070
|
}
|
|
25071
25071
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25072
|
+
className: aphrodite.css(styles$C.columnLeft)
|
|
25073
25073
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
|
-
className: aphrodite.css(styles$
|
|
25074
|
+
className: aphrodite.css(styles$C.tagsEditor)
|
|
25075
25075
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25076
25076
|
value: data,
|
|
25077
25077
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25102,23 +25102,23 @@ const ArrayNodeContent = props => {
|
|
|
25102
25102
|
const subpath = path.concat(i);
|
|
25103
25103
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25104
25104
|
key: "moveArrayElementUp",
|
|
25105
|
-
className: aphrodite.css(styles$
|
|
25105
|
+
className: aphrodite.css(styles$C.control)
|
|
25106
25106
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25107
25107
|
color: "orange",
|
|
25108
25108
|
title: "Move up",
|
|
25109
25109
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25110
25110
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25111
|
-
className: aphrodite.css(styles$
|
|
25111
|
+
className: aphrodite.css(styles$C.verticalFlip)
|
|
25112
25112
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25113
25113
|
key: "moveArrayElementDown",
|
|
25114
|
-
className: aphrodite.css(styles$
|
|
25114
|
+
className: aphrodite.css(styles$C.control)
|
|
25115
25115
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25116
25116
|
color: "orange",
|
|
25117
25117
|
title: "Move down",
|
|
25118
25118
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25119
25119
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25120
25120
|
key: "removeArrayElement",
|
|
25121
|
-
className: aphrodite.css(styles$
|
|
25121
|
+
className: aphrodite.css(styles$C.control)
|
|
25122
25122
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25123
25123
|
color: "orange",
|
|
25124
25124
|
title: "Delete",
|
|
@@ -25126,7 +25126,7 @@ const ArrayNodeContent = props => {
|
|
|
25126
25126
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25127
25127
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25128
25128
|
key: i,
|
|
25129
|
-
className: aphrodite.css(styles$
|
|
25129
|
+
className: aphrodite.css(styles$C.arrayElement, !elementIsLeaf && styles$C.arrayElementAndNotLeaf)
|
|
25130
25130
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25131
25131
|
key: i,
|
|
25132
25132
|
shape: shape.elementShape,
|
|
@@ -25152,7 +25152,7 @@ const ObjectNodeContent = props => {
|
|
|
25152
25152
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25153
25153
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25154
25154
|
key: subkey,
|
|
25155
|
-
className: aphrodite.css(styles$
|
|
25155
|
+
className: aphrodite.css(styles$C.objectElement)
|
|
25156
25156
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25157
25157
|
shape: shape.shape[subkey],
|
|
25158
25158
|
data: data[subkey],
|
|
@@ -25322,7 +25322,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25322
25322
|
}, this._renderContent());
|
|
25323
25323
|
}
|
|
25324
25324
|
}
|
|
25325
|
-
const styles$
|
|
25325
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
25326
25326
|
// This is used in a number of places throughout this file.
|
|
25327
25327
|
container: {},
|
|
25328
25328
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25424,116 +25424,6 @@ const styles$D = aphrodite.StyleSheet.create({
|
|
|
25424
25424
|
}
|
|
25425
25425
|
});
|
|
25426
25426
|
|
|
25427
|
-
/* eslint-disable react/no-unsafe */
|
|
25428
|
-
const StatefulArticleEditor = createReactClass__default["default"]({
|
|
25429
|
-
displayName: "StatefulArticleEditor",
|
|
25430
|
-
getInitialState: function () {
|
|
25431
|
-
return ___default["default"]({}).extend(this.props, {
|
|
25432
|
-
mode: "edit",
|
|
25433
|
-
onChange: this.handleChange,
|
|
25434
|
-
ref: "editor",
|
|
25435
|
-
screen: "phone"
|
|
25436
|
-
});
|
|
25437
|
-
},
|
|
25438
|
-
componentDidMount: function () {
|
|
25439
|
-
// TODO(scottgrant): This is a hack to remove the deprecated call to
|
|
25440
|
-
// this.isMounted() but is still considered an anti-pattern.
|
|
25441
|
-
this._isMounted = true;
|
|
25442
|
-
},
|
|
25443
|
-
// getInitialState isn't called if the react component is re-rendered
|
|
25444
|
-
// in-place on the dom, in which case this is called instead, so we
|
|
25445
|
-
// need to update the state here.
|
|
25446
|
-
// (This component is currently re-rendered by the "Add image" button.)
|
|
25447
|
-
UNSAFE_componentWillReceiveProps: function (nextProps) {
|
|
25448
|
-
// be careful not to overwrite our onChange and ref
|
|
25449
|
-
this.setState(___default["default"](nextProps).omit("onChange", "ref"));
|
|
25450
|
-
},
|
|
25451
|
-
componentWillUnmount: function () {
|
|
25452
|
-
this._isMounted = false;
|
|
25453
|
-
},
|
|
25454
|
-
getSaveWarnings: function () {
|
|
25455
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25456
|
-
return this.refs.editor.getSaveWarnings();
|
|
25457
|
-
},
|
|
25458
|
-
serialize: function () {
|
|
25459
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25460
|
-
return this.refs.editor.serialize();
|
|
25461
|
-
},
|
|
25462
|
-
handleChange: function (newState, cb) {
|
|
25463
|
-
if (this._isMounted) {
|
|
25464
|
-
this.setState(newState, cb);
|
|
25465
|
-
}
|
|
25466
|
-
},
|
|
25467
|
-
scorePreview: function () {
|
|
25468
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25469
|
-
return this.refs.editor.scorePreview();
|
|
25470
|
-
},
|
|
25471
|
-
render: function () {
|
|
25472
|
-
const {
|
|
25473
|
-
mode,
|
|
25474
|
-
screen
|
|
25475
|
-
} = this.state;
|
|
25476
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25477
|
-
style: styles$C.controlBar
|
|
25478
|
-
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25479
|
-
style: styles$C.controls
|
|
25480
|
-
}, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25481
|
-
onClick: () => this.setState({
|
|
25482
|
-
mode: "edit"
|
|
25483
|
-
}),
|
|
25484
|
-
style: mode === "edit" ? styles$C.controlSelected : styles$C.control
|
|
25485
|
-
}, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25486
|
-
onClick: () => this.setState({
|
|
25487
|
-
mode: "preview"
|
|
25488
|
-
}),
|
|
25489
|
-
style: mode === "preview" ? styles$C.controlSelected : styles$C.control
|
|
25490
|
-
}, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25491
|
-
onClick: () => this.setState({
|
|
25492
|
-
mode: "json"
|
|
25493
|
-
}),
|
|
25494
|
-
style: mode === "json" ? styles$C.controlSelected : styles$C.control
|
|
25495
|
-
}, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25496
|
-
style: styles$C.controls
|
|
25497
|
-
}, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25498
|
-
onClick: () => this.setState({
|
|
25499
|
-
screen: "phone"
|
|
25500
|
-
}),
|
|
25501
|
-
style: screen === "phone" ? styles$C.controlSelected : styles$C.control
|
|
25502
|
-
}, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25503
|
-
onClick: () => this.setState({
|
|
25504
|
-
screen: "tablet"
|
|
25505
|
-
}),
|
|
25506
|
-
style: screen === "tablet" ? styles$C.controlSelected : styles$C.control
|
|
25507
|
-
}, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25508
|
-
onClick: () => this.setState({
|
|
25509
|
-
screen: "desktop"
|
|
25510
|
-
}),
|
|
25511
|
-
style: screen === "desktop" ? styles$C.controlSelected : styles$C.control
|
|
25512
|
-
}, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25513
|
-
style: styles$C.editor
|
|
25514
|
-
}, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
|
|
25515
|
-
}
|
|
25516
|
-
});
|
|
25517
|
-
const styles$C = {
|
|
25518
|
-
controlBar: {
|
|
25519
|
-
marginBottom: 25,
|
|
25520
|
-
marginTop: 5
|
|
25521
|
-
},
|
|
25522
|
-
controls: {
|
|
25523
|
-
marginRight: 10
|
|
25524
|
-
},
|
|
25525
|
-
controlSelected: {
|
|
25526
|
-
cursor: "default",
|
|
25527
|
-
fontWeight: 700
|
|
25528
|
-
},
|
|
25529
|
-
control: {
|
|
25530
|
-
cursor: "pointer"
|
|
25531
|
-
},
|
|
25532
|
-
editor: {
|
|
25533
|
-
marginTop: -20
|
|
25534
|
-
}
|
|
25535
|
-
};
|
|
25536
|
-
|
|
25537
25427
|
/* eslint-disable react/no-unsafe, react/sort-comp */
|
|
25538
25428
|
|
|
25539
25429
|
/* Renders an EditorPage (or an ArticleEditor) as a non-controlled component.
|
|
@@ -29245,7 +29135,7 @@ class InteractionEditor extends React__namespace.Component {
|
|
|
29245
29135
|
gridStep: this.props.graph.gridStep,
|
|
29246
29136
|
markings: this.props.graph.markings,
|
|
29247
29137
|
onChange: this._updateGraphProps
|
|
29248
|
-
}), this.props.graph.valid !== true && /*#__PURE__*/React__namespace.createElement("div", null, this.props.graph.valid)), ___default["default"].map(this.props.elements, function (element, n) {
|
|
29138
|
+
}), /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, this.props.graph.valid !== true && /*#__PURE__*/React__namespace.createElement("div", null, this.props.graph.valid))), ___default["default"].map(this.props.elements, function (element, n) {
|
|
29249
29139
|
if (element.type === "movable-point") {
|
|
29250
29140
|
return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
|
|
29251
29141
|
title: /*#__PURE__*/React__namespace.createElement("span", null, "Movable point", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_{" + element.options.varSubscript + "}, y_{" + element.options.varSubscript + "})"))
|
|
@@ -29841,7 +29731,7 @@ const LockedFigureSelect = props => {
|
|
|
29841
29731
|
key: `${id}-${figureType}`,
|
|
29842
29732
|
label: figureType,
|
|
29843
29733
|
onClick: () => onChange(figureType)
|
|
29844
|
-
}
|
|
29734
|
+
}))));
|
|
29845
29735
|
};
|
|
29846
29736
|
const styles$x = aphrodite.StyleSheet.create({
|
|
29847
29737
|
container: {
|
|
@@ -30076,7 +29966,7 @@ const ColorSelect = props => {
|
|
|
30076
29966
|
color: colorName,
|
|
30077
29967
|
decorative: true
|
|
30078
29968
|
})
|
|
30079
|
-
}
|
|
29969
|
+
})))));
|
|
30080
29970
|
};
|
|
30081
29971
|
const styles$s = aphrodite.StyleSheet.create({
|
|
30082
29972
|
row: {
|
|
@@ -30271,7 +30161,7 @@ const LockedEllipseSettings = props => {
|
|
|
30271
30161
|
key: option,
|
|
30272
30162
|
value: option,
|
|
30273
30163
|
label: option
|
|
30274
|
-
}
|
|
30164
|
+
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30275
30165
|
tag: "label",
|
|
30276
30166
|
style: styles$p.row
|
|
30277
30167
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
@@ -30287,10 +30177,10 @@ const LockedEllipseSettings = props => {
|
|
|
30287
30177
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30288
30178
|
value: "solid",
|
|
30289
30179
|
label: "solid"
|
|
30290
|
-
}
|
|
30180
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30291
30181
|
value: "dashed",
|
|
30292
30182
|
label: "dashed"
|
|
30293
|
-
}
|
|
30183
|
+
}))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30294
30184
|
showM2Features: props.showM2Features,
|
|
30295
30185
|
figureType: props.type,
|
|
30296
30186
|
onMove: onMove,
|
|
@@ -30763,7 +30653,7 @@ const LockedPolygonSettings = props => {
|
|
|
30763
30653
|
key: option,
|
|
30764
30654
|
value: option,
|
|
30765
30655
|
label: option
|
|
30766
|
-
}
|
|
30656
|
+
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30767
30657
|
tag: "label",
|
|
30768
30658
|
style: [styles$i.row, styles$i.spaceUnder]
|
|
30769
30659
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
@@ -30779,10 +30669,10 @@ const LockedPolygonSettings = props => {
|
|
|
30779
30669
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30780
30670
|
value: "solid",
|
|
30781
30671
|
label: "solid"
|
|
30782
|
-
}
|
|
30672
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30783
30673
|
value: "dashed",
|
|
30784
30674
|
label: "dashed"
|
|
30785
|
-
}
|
|
30675
|
+
}))), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30786
30676
|
label: "show vertices",
|
|
30787
30677
|
checked: showVertices,
|
|
30788
30678
|
onChange: newValue => onChangeProps({
|
|
@@ -36608,7 +36498,6 @@ exports.EditorPage = EditorPage;
|
|
|
36608
36498
|
exports.IframeContentRenderer = IframeContentRenderer;
|
|
36609
36499
|
exports.ItemDiff = ItemDiff;
|
|
36610
36500
|
exports.MultiRendererEditor = MultiRendererEditor;
|
|
36611
|
-
exports.StatefulArticleEditor = StatefulArticleEditor;
|
|
36612
36501
|
exports.StatefulEditorPage = StatefulEditorPage;
|
|
36613
36502
|
exports.StructuredItemDiff = StructuredItemDiff;
|
|
36614
36503
|
exports.ViewportResizer = ViewportResizer;
|