@khanacademy/perseus-editor 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/heading.d.ts +7 -0
- package/dist/components/{graph-locked-figures/locked-figure-settings-accordion.d.ts → perseus-editor-accordion.d.ts} +2 -2
- package/dist/es/index.js +171 -162
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +174 -165
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +143 -210
- package/package.json +2 -2
- /package/dist/components/{graph-locked-figures/coordinate-pair-input.d.ts → coordinate-pair-input.d.ts} +0 -0
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
panelStyle?: StyleType;
|
|
9
9
|
onToggle?: (expanded: boolean) => void;
|
|
10
10
|
};
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const PerseusEditorAccordion: (props: Props) => JSX.Element;
|
|
12
|
+
export default PerseusEditorAccordion;
|
package/dist/es/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import Banner from '@khanacademy/wonder-blocks-banner';
|
|
|
36
36
|
|
|
37
37
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
38
38
|
const libName = "@khanacademy/perseus-editor";
|
|
39
|
-
const libVersion = "7.0.
|
|
39
|
+
const libVersion = "7.0.2";
|
|
40
40
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41
41
|
|
|
42
42
|
function _extends() {
|
|
@@ -29768,71 +29768,6 @@ const styles$v = StyleSheet.create({
|
|
|
29768
29768
|
}
|
|
29769
29769
|
});
|
|
29770
29770
|
|
|
29771
|
-
const ColorSwatch = props => {
|
|
29772
|
-
const {
|
|
29773
|
-
color: color$1,
|
|
29774
|
-
filled = true,
|
|
29775
|
-
decorative = false
|
|
29776
|
-
} = props;
|
|
29777
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
29778
|
-
"aria-label":
|
|
29779
|
-
// Don't include an aria label for decorative circles.
|
|
29780
|
-
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
29781
|
-
style: [styles$u.colorSwatch, {
|
|
29782
|
-
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
29783
|
-
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
29784
|
-
}]
|
|
29785
|
-
});
|
|
29786
|
-
};
|
|
29787
|
-
const styles$u = StyleSheet.create({
|
|
29788
|
-
colorSwatch: {
|
|
29789
|
-
// Add a white outline so that the color swatch is visible when
|
|
29790
|
-
// the dropdown option is highlighted with its blue background.
|
|
29791
|
-
outline: `2px solid ${color.offWhite}`,
|
|
29792
|
-
borderRadius: "50%",
|
|
29793
|
-
width: spacing.large_24,
|
|
29794
|
-
height: spacing.large_24
|
|
29795
|
-
}
|
|
29796
|
-
});
|
|
29797
|
-
|
|
29798
|
-
const possibleColors = Object.keys(lockedFigureColors);
|
|
29799
|
-
const ColorSelect = props => {
|
|
29800
|
-
const {
|
|
29801
|
-
selectedValue,
|
|
29802
|
-
style,
|
|
29803
|
-
onChange
|
|
29804
|
-
} = props;
|
|
29805
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
29806
|
-
style: [styles$t.row, style]
|
|
29807
|
-
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29808
|
-
tag: "label",
|
|
29809
|
-
style: styles$t.row
|
|
29810
|
-
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
29811
|
-
size: spacing.xxSmall_6
|
|
29812
|
-
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
29813
|
-
selectedValue: selectedValue,
|
|
29814
|
-
onChange: onChange
|
|
29815
|
-
// Placeholder is required, but never gets used.
|
|
29816
|
-
,
|
|
29817
|
-
placeholder: ""
|
|
29818
|
-
}, possibleColors.map(colorName => /*#__PURE__*/React.createElement(OptionItem, {
|
|
29819
|
-
key: colorName,
|
|
29820
|
-
value: colorName,
|
|
29821
|
-
label: colorName,
|
|
29822
|
-
leftAccessory: /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
29823
|
-
color: colorName,
|
|
29824
|
-
decorative: true
|
|
29825
|
-
})
|
|
29826
|
-
}, colorName)))));
|
|
29827
|
-
};
|
|
29828
|
-
const styles$t = StyleSheet.create({
|
|
29829
|
-
row: {
|
|
29830
|
-
display: "flex",
|
|
29831
|
-
flexDirection: "row",
|
|
29832
|
-
alignItems: "center"
|
|
29833
|
-
}
|
|
29834
|
-
});
|
|
29835
|
-
|
|
29836
29771
|
const CoordinatePairInput = props => {
|
|
29837
29772
|
const {
|
|
29838
29773
|
coord,
|
|
@@ -29865,32 +29800,32 @@ const CoordinatePairInput = props => {
|
|
|
29865
29800
|
onChange(newCoords);
|
|
29866
29801
|
}
|
|
29867
29802
|
return /*#__PURE__*/React.createElement(View, {
|
|
29868
|
-
style: [styles$
|
|
29803
|
+
style: [styles$u.row, style]
|
|
29869
29804
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29870
29805
|
tag: "label",
|
|
29871
|
-
style: styles$
|
|
29806
|
+
style: styles$u.row
|
|
29872
29807
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29873
29808
|
size: spacing.xxSmall_6
|
|
29874
29809
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29875
29810
|
type: "number",
|
|
29876
29811
|
value: coordState[0],
|
|
29877
29812
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29878
|
-
style: [styles$
|
|
29813
|
+
style: [styles$u.textField, error ? styles$u.errorField : undefined]
|
|
29879
29814
|
})), /*#__PURE__*/React.createElement(Strut, {
|
|
29880
29815
|
size: spacing.medium_16
|
|
29881
29816
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29882
29817
|
tag: "label",
|
|
29883
|
-
style: styles$
|
|
29818
|
+
style: styles$u.row
|
|
29884
29819
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29885
29820
|
size: spacing.xxSmall_6
|
|
29886
29821
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29887
29822
|
type: "number",
|
|
29888
29823
|
value: coordState[1],
|
|
29889
29824
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29890
|
-
style: [styles$
|
|
29825
|
+
style: [styles$u.textField, error ? styles$u.errorField : undefined]
|
|
29891
29826
|
})));
|
|
29892
29827
|
};
|
|
29893
|
-
const styles$
|
|
29828
|
+
const styles$u = StyleSheet.create({
|
|
29894
29829
|
row: {
|
|
29895
29830
|
display: "flex",
|
|
29896
29831
|
flexDirection: "row",
|
|
@@ -29905,44 +29840,7 @@ const styles$s = StyleSheet.create({
|
|
|
29905
29840
|
}
|
|
29906
29841
|
});
|
|
29907
29842
|
|
|
29908
|
-
const
|
|
29909
|
-
const {
|
|
29910
|
-
color,
|
|
29911
|
-
fillStyle,
|
|
29912
|
-
strokeStyle
|
|
29913
|
-
} = props;
|
|
29914
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
29915
|
-
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
29916
|
-
style: [styles$r.container, {
|
|
29917
|
-
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
29918
|
-
}]
|
|
29919
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
29920
|
-
style: [styles$r.innerCircle, {
|
|
29921
|
-
backgroundColor: lockedFigureColors[color],
|
|
29922
|
-
opacity: lockedFigureFillStyles[fillStyle]
|
|
29923
|
-
}]
|
|
29924
|
-
}));
|
|
29925
|
-
};
|
|
29926
|
-
const styles$r = StyleSheet.create({
|
|
29927
|
-
container: {
|
|
29928
|
-
// Add a white outline so that the color swatch is visible when
|
|
29929
|
-
// the dropdown option is highlighted with its blue background.
|
|
29930
|
-
outline: `2px solid ${color.offWhite}`,
|
|
29931
|
-
borderRadius: "50%",
|
|
29932
|
-
width: spacing.xLarge_32,
|
|
29933
|
-
height: spacing.large_24,
|
|
29934
|
-
backgroundColor: color.white,
|
|
29935
|
-
alignItems: "center",
|
|
29936
|
-
justifyContent: "center"
|
|
29937
|
-
},
|
|
29938
|
-
innerCircle: {
|
|
29939
|
-
width: 28,
|
|
29940
|
-
height: 20,
|
|
29941
|
-
borderRadius: "50%"
|
|
29942
|
-
}
|
|
29943
|
-
});
|
|
29944
|
-
|
|
29945
|
-
const LockedFigureSettingsAccordion = props => {
|
|
29843
|
+
const PerseusEditorAccordion = props => {
|
|
29946
29844
|
const {
|
|
29947
29845
|
children,
|
|
29948
29846
|
header,
|
|
@@ -29956,18 +29854,18 @@ const LockedFigureSettingsAccordion = props => {
|
|
|
29956
29854
|
// .heading > h2 > .header styles from the articles.less
|
|
29957
29855
|
// file (which is imported in perseus-renderer.less).
|
|
29958
29856
|
, {
|
|
29959
|
-
className: "
|
|
29857
|
+
className: "perseus-editor-accordion"
|
|
29960
29858
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
29961
29859
|
expanded: expanded,
|
|
29962
29860
|
onToggle: onToggle,
|
|
29963
|
-
style: [styles$
|
|
29964
|
-
headerStyle: styles$
|
|
29861
|
+
style: [styles$t.container, containerStyle],
|
|
29862
|
+
headerStyle: styles$t.accordionHeader,
|
|
29965
29863
|
header: header
|
|
29966
29864
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29967
|
-
style: [styles$
|
|
29865
|
+
style: [styles$t.accordionPanel, panelStyle]
|
|
29968
29866
|
}, children)));
|
|
29969
29867
|
};
|
|
29970
|
-
const styles$
|
|
29868
|
+
const styles$t = StyleSheet.create({
|
|
29971
29869
|
container: {
|
|
29972
29870
|
backgroundColor: color.fadedBlue8,
|
|
29973
29871
|
marginTop: spacing.xSmall_8
|
|
@@ -29988,6 +29886,108 @@ const styles$q = StyleSheet.create({
|
|
|
29988
29886
|
}
|
|
29989
29887
|
});
|
|
29990
29888
|
|
|
29889
|
+
const ColorSwatch = props => {
|
|
29890
|
+
const {
|
|
29891
|
+
color: color$1,
|
|
29892
|
+
filled = true,
|
|
29893
|
+
decorative = false
|
|
29894
|
+
} = props;
|
|
29895
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
29896
|
+
"aria-label":
|
|
29897
|
+
// Don't include an aria label for decorative circles.
|
|
29898
|
+
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
29899
|
+
style: [styles$s.colorSwatch, {
|
|
29900
|
+
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
29901
|
+
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
29902
|
+
}]
|
|
29903
|
+
});
|
|
29904
|
+
};
|
|
29905
|
+
const styles$s = StyleSheet.create({
|
|
29906
|
+
colorSwatch: {
|
|
29907
|
+
// Add a white outline so that the color swatch is visible when
|
|
29908
|
+
// the dropdown option is highlighted with its blue background.
|
|
29909
|
+
outline: `2px solid ${color.offWhite}`,
|
|
29910
|
+
borderRadius: "50%",
|
|
29911
|
+
width: spacing.large_24,
|
|
29912
|
+
height: spacing.large_24
|
|
29913
|
+
}
|
|
29914
|
+
});
|
|
29915
|
+
|
|
29916
|
+
const possibleColors = Object.keys(lockedFigureColors);
|
|
29917
|
+
const ColorSelect = props => {
|
|
29918
|
+
const {
|
|
29919
|
+
selectedValue,
|
|
29920
|
+
style,
|
|
29921
|
+
onChange
|
|
29922
|
+
} = props;
|
|
29923
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
29924
|
+
style: [styles$r.row, style]
|
|
29925
|
+
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29926
|
+
tag: "label",
|
|
29927
|
+
style: styles$r.row
|
|
29928
|
+
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
29929
|
+
size: spacing.xxSmall_6
|
|
29930
|
+
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
29931
|
+
selectedValue: selectedValue,
|
|
29932
|
+
onChange: onChange
|
|
29933
|
+
// Placeholder is required, but never gets used.
|
|
29934
|
+
,
|
|
29935
|
+
placeholder: ""
|
|
29936
|
+
}, possibleColors.map(colorName => /*#__PURE__*/React.createElement(OptionItem, {
|
|
29937
|
+
key: colorName,
|
|
29938
|
+
value: colorName,
|
|
29939
|
+
label: colorName,
|
|
29940
|
+
leftAccessory: /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
29941
|
+
color: colorName,
|
|
29942
|
+
decorative: true
|
|
29943
|
+
})
|
|
29944
|
+
}, colorName)))));
|
|
29945
|
+
};
|
|
29946
|
+
const styles$r = StyleSheet.create({
|
|
29947
|
+
row: {
|
|
29948
|
+
display: "flex",
|
|
29949
|
+
flexDirection: "row",
|
|
29950
|
+
alignItems: "center"
|
|
29951
|
+
}
|
|
29952
|
+
});
|
|
29953
|
+
|
|
29954
|
+
const EllipseSwatch = props => {
|
|
29955
|
+
const {
|
|
29956
|
+
color,
|
|
29957
|
+
fillStyle,
|
|
29958
|
+
strokeStyle
|
|
29959
|
+
} = props;
|
|
29960
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
29961
|
+
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
29962
|
+
style: [styles$q.container, {
|
|
29963
|
+
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
29964
|
+
}]
|
|
29965
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
29966
|
+
style: [styles$q.innerCircle, {
|
|
29967
|
+
backgroundColor: lockedFigureColors[color],
|
|
29968
|
+
opacity: lockedFigureFillStyles[fillStyle]
|
|
29969
|
+
}]
|
|
29970
|
+
}));
|
|
29971
|
+
};
|
|
29972
|
+
const styles$q = StyleSheet.create({
|
|
29973
|
+
container: {
|
|
29974
|
+
// Add a white outline so that the color swatch is visible when
|
|
29975
|
+
// the dropdown option is highlighted with its blue background.
|
|
29976
|
+
outline: `2px solid ${color.offWhite}`,
|
|
29977
|
+
borderRadius: "50%",
|
|
29978
|
+
width: spacing.xLarge_32,
|
|
29979
|
+
height: spacing.large_24,
|
|
29980
|
+
backgroundColor: color.white,
|
|
29981
|
+
alignItems: "center",
|
|
29982
|
+
justifyContent: "center"
|
|
29983
|
+
},
|
|
29984
|
+
innerCircle: {
|
|
29985
|
+
width: 28,
|
|
29986
|
+
height: 20,
|
|
29987
|
+
borderRadius: "50%"
|
|
29988
|
+
}
|
|
29989
|
+
});
|
|
29990
|
+
|
|
29991
29991
|
/**
|
|
29992
29992
|
* The part of a locked figure settings panel that contains actions
|
|
29993
29993
|
* for this panel and its associated locked figure, including
|
|
@@ -30073,7 +30073,7 @@ const LockedEllipseSettings = props => {
|
|
|
30073
30073
|
color: newValue
|
|
30074
30074
|
});
|
|
30075
30075
|
}
|
|
30076
|
-
return /*#__PURE__*/React.createElement(
|
|
30076
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30077
30077
|
expanded: expanded,
|
|
30078
30078
|
onToggle: onToggle,
|
|
30079
30079
|
header:
|
|
@@ -30226,7 +30226,7 @@ const DefiningPointSettings = props => {
|
|
|
30226
30226
|
color: newValue
|
|
30227
30227
|
});
|
|
30228
30228
|
}
|
|
30229
|
-
return /*#__PURE__*/React.createElement(
|
|
30229
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30230
30230
|
expanded: expanded,
|
|
30231
30231
|
onToggle: onToggle,
|
|
30232
30232
|
containerStyle: styles$m.container,
|
|
@@ -30355,7 +30355,7 @@ const LockedLineSettings = props => {
|
|
|
30355
30355
|
})]
|
|
30356
30356
|
});
|
|
30357
30357
|
}
|
|
30358
|
-
return /*#__PURE__*/React.createElement(
|
|
30358
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30359
30359
|
expanded: props.expanded,
|
|
30360
30360
|
onToggle: props.onToggle,
|
|
30361
30361
|
header: /*#__PURE__*/React.createElement(View, {
|
|
@@ -30480,7 +30480,7 @@ const LockedPointSettings = props => {
|
|
|
30480
30480
|
color: newValue
|
|
30481
30481
|
});
|
|
30482
30482
|
}
|
|
30483
|
-
return /*#__PURE__*/React.createElement(
|
|
30483
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30484
30484
|
expanded: props.expanded,
|
|
30485
30485
|
onToggle: props.onToggle,
|
|
30486
30486
|
header:
|
|
@@ -30584,7 +30584,7 @@ const LockedPolygonSettings = props => {
|
|
|
30584
30584
|
color: newValue
|
|
30585
30585
|
});
|
|
30586
30586
|
}
|
|
30587
|
-
return /*#__PURE__*/React.createElement(
|
|
30587
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30588
30588
|
expanded: expanded,
|
|
30589
30589
|
onToggle: onToggle,
|
|
30590
30590
|
header:
|
|
@@ -30649,7 +30649,7 @@ const LockedPolygonSettings = props => {
|
|
|
30649
30649
|
showVertices: newValue
|
|
30650
30650
|
}),
|
|
30651
30651
|
style: styles$h.spaceUnder
|
|
30652
|
-
}), /*#__PURE__*/React.createElement(
|
|
30652
|
+
}), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30653
30653
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
|
|
30654
30654
|
expanded: true,
|
|
30655
30655
|
containerStyle: styles$h.pointAccordionContainer,
|
|
@@ -30757,7 +30757,7 @@ const LockedVectorSettings = props => {
|
|
|
30757
30757
|
color: newColor
|
|
30758
30758
|
});
|
|
30759
30759
|
}
|
|
30760
|
-
return /*#__PURE__*/React.createElement(
|
|
30760
|
+
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30761
30761
|
expanded: props.expanded,
|
|
30762
30762
|
onToggle: props.onToggle,
|
|
30763
30763
|
header: /*#__PURE__*/React.createElement(View, {
|
|
@@ -30775,7 +30775,7 @@ const LockedVectorSettings = props => {
|
|
|
30775
30775
|
onChange: handleColorChange
|
|
30776
30776
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30777
30777
|
style: styles$g.errorText
|
|
30778
|
-
}, lengthErrorMessage), /*#__PURE__*/React.createElement(
|
|
30778
|
+
}, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30779
30779
|
expanded: true // Initial state is expanded
|
|
30780
30780
|
,
|
|
30781
30781
|
containerStyle: styles$g.container,
|
|
@@ -30789,7 +30789,7 @@ const LockedVectorSettings = props => {
|
|
|
30789
30789
|
onChange: newProps => {
|
|
30790
30790
|
handleChangePoint(newProps, 0);
|
|
30791
30791
|
}
|
|
30792
|
-
})), /*#__PURE__*/React.createElement(
|
|
30792
|
+
})), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30793
30793
|
expanded: true // Initial state is expanded
|
|
30794
30794
|
,
|
|
30795
30795
|
containerStyle: styles$g.container,
|
|
@@ -31087,20 +31087,6 @@ const styles$d = StyleSheet.create({
|
|
|
31087
31087
|
}
|
|
31088
31088
|
});
|
|
31089
31089
|
|
|
31090
|
-
const {
|
|
31091
|
-
ButtonGroup: ButtonGroup$2,
|
|
31092
|
-
InfoTip: InfoTip$c,
|
|
31093
|
-
PropCheckBox: PropCheckBox$7,
|
|
31094
|
-
RangeInput: RangeInput$4
|
|
31095
|
-
} = components;
|
|
31096
|
-
const defaultBackgroundImage$1 = {
|
|
31097
|
-
url: null,
|
|
31098
|
-
width: 0,
|
|
31099
|
-
height: 0
|
|
31100
|
-
};
|
|
31101
|
-
function numSteps(range, step) {
|
|
31102
|
-
return Math.floor((range[1] - range[0]) / step);
|
|
31103
|
-
}
|
|
31104
31090
|
function Heading({
|
|
31105
31091
|
title,
|
|
31106
31092
|
isOpen,
|
|
@@ -31125,6 +31111,21 @@ function Heading({
|
|
|
31125
31111
|
isExpanded: isOpen
|
|
31126
31112
|
}));
|
|
31127
31113
|
}
|
|
31114
|
+
|
|
31115
|
+
const {
|
|
31116
|
+
ButtonGroup: ButtonGroup$2,
|
|
31117
|
+
InfoTip: InfoTip$c,
|
|
31118
|
+
PropCheckBox: PropCheckBox$7,
|
|
31119
|
+
RangeInput: RangeInput$4
|
|
31120
|
+
} = components;
|
|
31121
|
+
const defaultBackgroundImage$1 = {
|
|
31122
|
+
url: null,
|
|
31123
|
+
width: 0,
|
|
31124
|
+
height: 0
|
|
31125
|
+
};
|
|
31126
|
+
function numSteps(range, step) {
|
|
31127
|
+
return Math.floor((range[1] - range[0]) / step);
|
|
31128
|
+
}
|
|
31128
31129
|
class InteractiveGraphSettings extends React.Component {
|
|
31129
31130
|
static stateFromProps(props) {
|
|
31130
31131
|
return {
|
|
@@ -31731,15 +31732,6 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31731
31732
|
UNSAFE_componentWillMount() {
|
|
31732
31733
|
DeprecationMixin.UNSAFE_componentWillMount.call(this);
|
|
31733
31734
|
}
|
|
31734
|
-
static buildGraphKey(correct) {
|
|
31735
|
-
const testGraphKey = [];
|
|
31736
|
-
for (const key in correct) {
|
|
31737
|
-
if (correct[key]) {
|
|
31738
|
-
typeof correct[key] === "number" || typeof correct[key] === "string" || typeof correct[key] === "boolean" ? testGraphKey.push(correct[key]) : testGraphKey.push(0);
|
|
31739
|
-
}
|
|
31740
|
-
}
|
|
31741
|
-
return testGraphKey.join(":");
|
|
31742
|
-
}
|
|
31743
31735
|
render() {
|
|
31744
31736
|
var _this$props$graph$typ, _this$props$graph, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$apiOption, _this$props$apiOption2, _this$props$apiOption3;
|
|
31745
31737
|
let graph;
|
|
@@ -31783,9 +31775,6 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31783
31775
|
});
|
|
31784
31776
|
}
|
|
31785
31777
|
};
|
|
31786
|
-
// This is used to force a remount of the graph component
|
|
31787
|
-
// when there's a significant change
|
|
31788
|
-
const graphKey = InteractiveGraphEditor.buildGraphKey(correct);
|
|
31789
31778
|
graph =
|
|
31790
31779
|
/*#__PURE__*/
|
|
31791
31780
|
// There are a bunch of props that renderer.jsx passes to widgets via
|
|
@@ -31793,7 +31782,6 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31793
31782
|
// bother passing.
|
|
31794
31783
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
31795
31784
|
React.createElement(InteractiveGraph, _extends({}, graphProps, {
|
|
31796
|
-
key: graphKey,
|
|
31797
31785
|
containerSizeClass: sizeClass,
|
|
31798
31786
|
apiOptions: _extends({}, this.props.apiOptions, {
|
|
31799
31787
|
isMobile: false
|
|
@@ -31831,6 +31819,10 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31831
31819
|
correct: {
|
|
31832
31820
|
type: "point",
|
|
31833
31821
|
numPoints: points
|
|
31822
|
+
},
|
|
31823
|
+
graph: {
|
|
31824
|
+
type: "point",
|
|
31825
|
+
numPoints: points
|
|
31834
31826
|
}
|
|
31835
31827
|
});
|
|
31836
31828
|
}
|
|
@@ -31850,7 +31842,8 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31850
31842
|
snapTo: "grid"
|
|
31851
31843
|
});
|
|
31852
31844
|
this.props.onChange({
|
|
31853
|
-
correct: graph
|
|
31845
|
+
correct: graph,
|
|
31846
|
+
graph: graph
|
|
31854
31847
|
});
|
|
31855
31848
|
},
|
|
31856
31849
|
style: styles$a.singleSelectShort
|
|
@@ -31892,11 +31885,17 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31892
31885
|
// Don't show indeterminate checkbox state
|
|
31893
31886
|
!!((_this$props$correct8 = this.props.correct) != null && _this$props$correct8.showAngles),
|
|
31894
31887
|
onChange: () => {
|
|
31895
|
-
|
|
31896
|
-
|
|
31897
|
-
|
|
31898
|
-
|
|
31899
|
-
|
|
31888
|
+
var _this$props$graph2;
|
|
31889
|
+
if (((_this$props$graph2 = this.props.graph) == null ? void 0 : _this$props$graph2.type) === "polygon") {
|
|
31890
|
+
this.props.onChange({
|
|
31891
|
+
correct: _extends({}, this.props.correct, {
|
|
31892
|
+
showAngles: !this.props.correct.showAngles
|
|
31893
|
+
}),
|
|
31894
|
+
graph: _extends({}, this.props.graph, {
|
|
31895
|
+
showAngles: !this.props.graph.showAngles
|
|
31896
|
+
})
|
|
31897
|
+
});
|
|
31898
|
+
}
|
|
31900
31899
|
}
|
|
31901
31900
|
}), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Displays the interior angle measures."))), /*#__PURE__*/React.createElement(View, {
|
|
31902
31901
|
style: styles$a.row
|
|
@@ -31906,11 +31905,17 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31906
31905
|
// Don't show indeterminate checkbox state
|
|
31907
31906
|
!!((_this$props$correct9 = this.props.correct) != null && _this$props$correct9.showSides),
|
|
31908
31907
|
onChange: () => {
|
|
31909
|
-
|
|
31910
|
-
|
|
31911
|
-
|
|
31912
|
-
|
|
31913
|
-
|
|
31908
|
+
var _this$props$graph3;
|
|
31909
|
+
if (((_this$props$graph3 = this.props.graph) == null ? void 0 : _this$props$graph3.type) === "polygon") {
|
|
31910
|
+
this.props.onChange({
|
|
31911
|
+
correct: _extends({}, this.props.correct, {
|
|
31912
|
+
showSides: !this.props.correct.showSides
|
|
31913
|
+
}),
|
|
31914
|
+
graph: _extends({}, this.props.graph, {
|
|
31915
|
+
showSides: !this.props.graph.showSides
|
|
31916
|
+
})
|
|
31917
|
+
});
|
|
31918
|
+
}
|
|
31914
31919
|
}
|
|
31915
31920
|
}), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Displays the side lengths.")))), ((_this$props$correct10 = this.props.correct) == null ? void 0 : _this$props$correct10.type) === "segment" && /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31916
31921
|
label: "Number of segments:"
|
|
@@ -31922,6 +31927,10 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31922
31927
|
type: "segment",
|
|
31923
31928
|
numSegments: sides,
|
|
31924
31929
|
coords: null
|
|
31930
|
+
},
|
|
31931
|
+
graph: {
|
|
31932
|
+
type: "segment",
|
|
31933
|
+
numSegments: sides
|
|
31925
31934
|
}
|
|
31926
31935
|
});
|
|
31927
31936
|
}
|