@khanacademy/perseus-editor 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +48 -50
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +50 -51
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +372 -248
- package/package.json +6 -2
package/dist/es/index.js
CHANGED
|
@@ -21,14 +21,15 @@ import { useMathInputI18n, createMathField } from '@khanacademy/math-input';
|
|
|
21
21
|
import { SingleSelect, OptionItem, ActionMenu, ActionItem } from '@khanacademy/wonder-blocks-dropdown';
|
|
22
22
|
import { TextField, Checkbox as Checkbox$1 } from '@khanacademy/wonder-blocks-form';
|
|
23
23
|
import { LabelSmall, LabelMedium, LabelLarge, BodyMonospace } from '@khanacademy/wonder-blocks-typography';
|
|
24
|
-
import
|
|
24
|
+
import Banner from '@khanacademy/wonder-blocks-banner';
|
|
25
25
|
import { AccordionSection } from '@khanacademy/wonder-blocks-accordion';
|
|
26
26
|
import Button from '@khanacademy/wonder-blocks-button';
|
|
27
27
|
import trashIcon from '@phosphor-icons/core/bold/trash-bold.svg';
|
|
28
|
+
import Switch from '@khanacademy/wonder-blocks-switch';
|
|
28
29
|
|
|
29
30
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
30
31
|
const libName = "@khanacademy/perseus-editor";
|
|
31
|
-
const libVersion = "6.2.
|
|
32
|
+
const libVersion = "6.2.1";
|
|
32
33
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
33
34
|
|
|
34
35
|
function _extends() {
|
|
@@ -29962,7 +29963,11 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29962
29963
|
onBlur: this.changeBackgroundUrl
|
|
29963
29964
|
}), /*#__PURE__*/React.createElement(InfoTip$c, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
|
|
29964
29965
|
style: styles$k.rulerSection
|
|
29965
|
-
}, /*#__PURE__*/React.createElement(
|
|
29966
|
+
}, /*#__PURE__*/React.createElement(Banner, {
|
|
29967
|
+
layout: "floating",
|
|
29968
|
+
text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
|
|
29969
|
+
kind: "warning"
|
|
29970
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
29966
29971
|
style: styles$k.checkboxRow
|
|
29967
29972
|
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29968
29973
|
label: "Show ruler",
|
|
@@ -30073,7 +30078,8 @@ const styles$k = StyleSheet.create({
|
|
|
30073
30078
|
checkboxRow: {
|
|
30074
30079
|
flexDirection: "row",
|
|
30075
30080
|
alignItems: "center",
|
|
30076
|
-
justifyContent: "space-between"
|
|
30081
|
+
justifyContent: "space-between",
|
|
30082
|
+
marginTop: spacing.xSmall_8
|
|
30077
30083
|
},
|
|
30078
30084
|
rulerSection: {
|
|
30079
30085
|
marginTop: spacing.xSmall_8,
|
|
@@ -30269,35 +30275,6 @@ const styles$h = StyleSheet.create({
|
|
|
30269
30275
|
}
|
|
30270
30276
|
});
|
|
30271
30277
|
|
|
30272
|
-
const LabeledSwitch = props => {
|
|
30273
|
-
const {
|
|
30274
|
-
checked,
|
|
30275
|
-
label,
|
|
30276
|
-
style,
|
|
30277
|
-
onChange
|
|
30278
|
-
} = props;
|
|
30279
|
-
const ids = useUniqueIdWithMock();
|
|
30280
|
-
const switchId = ids.get("switch");
|
|
30281
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
30282
|
-
style: [styles$g.row, style]
|
|
30283
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30284
|
-
id: switchId,
|
|
30285
|
-
checked: checked,
|
|
30286
|
-
onChange: onChange
|
|
30287
|
-
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30288
|
-
size: spacing.xSmall_8
|
|
30289
|
-
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30290
|
-
tag: "label",
|
|
30291
|
-
htmlFor: switchId
|
|
30292
|
-
}, label));
|
|
30293
|
-
};
|
|
30294
|
-
const styles$g = StyleSheet.create({
|
|
30295
|
-
row: {
|
|
30296
|
-
flexDirection: "row",
|
|
30297
|
-
alignItems: "center"
|
|
30298
|
-
}
|
|
30299
|
-
});
|
|
30300
|
-
|
|
30301
30278
|
const LockedFigureSettingsAccordion = props => {
|
|
30302
30279
|
const {
|
|
30303
30280
|
children,
|
|
@@ -30312,14 +30289,14 @@ const LockedFigureSettingsAccordion = props => {
|
|
|
30312
30289
|
, {
|
|
30313
30290
|
className: "locked-figure-accordion"
|
|
30314
30291
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
30315
|
-
style: [styles$
|
|
30316
|
-
headerStyle: styles$
|
|
30292
|
+
style: [styles$g.container, containerStyle],
|
|
30293
|
+
headerStyle: styles$g.accordionHeader,
|
|
30317
30294
|
header: header
|
|
30318
30295
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30319
|
-
style: [styles$
|
|
30296
|
+
style: [styles$g.accordionPanel, panelStyle]
|
|
30320
30297
|
}, children)));
|
|
30321
30298
|
};
|
|
30322
|
-
const styles$
|
|
30299
|
+
const styles$g = StyleSheet.create({
|
|
30323
30300
|
container: {
|
|
30324
30301
|
backgroundColor: color.fadedBlue8,
|
|
30325
30302
|
marginTop: spacing.xSmall_8
|
|
@@ -30351,16 +30328,16 @@ const LockedFigureSettingsActions = props => {
|
|
|
30351
30328
|
figureAriaLabel
|
|
30352
30329
|
} = props;
|
|
30353
30330
|
return /*#__PURE__*/React.createElement(View, {
|
|
30354
|
-
style: styles$
|
|
30331
|
+
style: styles$f.container
|
|
30355
30332
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
30356
30333
|
startIcon: trashIcon,
|
|
30357
30334
|
"aria-label": `Delete ${figureAriaLabel}`,
|
|
30358
30335
|
onClick: onRemove,
|
|
30359
30336
|
kind: "tertiary",
|
|
30360
|
-
style: styles$
|
|
30337
|
+
style: styles$f.deleteButton
|
|
30361
30338
|
}, "Delete"));
|
|
30362
30339
|
};
|
|
30363
|
-
const styles$
|
|
30340
|
+
const styles$f = StyleSheet.create({
|
|
30364
30341
|
container: {
|
|
30365
30342
|
width: "100%",
|
|
30366
30343
|
flexDirection: "row",
|
|
@@ -30373,6 +30350,35 @@ const styles$e = StyleSheet.create({
|
|
|
30373
30350
|
}
|
|
30374
30351
|
});
|
|
30375
30352
|
|
|
30353
|
+
const LabeledSwitch = props => {
|
|
30354
|
+
const {
|
|
30355
|
+
checked,
|
|
30356
|
+
label,
|
|
30357
|
+
style,
|
|
30358
|
+
onChange
|
|
30359
|
+
} = props;
|
|
30360
|
+
const ids = useUniqueIdWithMock();
|
|
30361
|
+
const switchId = ids.get("switch");
|
|
30362
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30363
|
+
style: [styles$e.row, style]
|
|
30364
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30365
|
+
id: switchId,
|
|
30366
|
+
checked: checked,
|
|
30367
|
+
onChange: onChange
|
|
30368
|
+
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30369
|
+
size: spacing.xSmall_8
|
|
30370
|
+
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30371
|
+
tag: "label",
|
|
30372
|
+
htmlFor: switchId
|
|
30373
|
+
}, label));
|
|
30374
|
+
};
|
|
30375
|
+
const styles$e = StyleSheet.create({
|
|
30376
|
+
row: {
|
|
30377
|
+
flexDirection: "row",
|
|
30378
|
+
alignItems: "center"
|
|
30379
|
+
}
|
|
30380
|
+
});
|
|
30381
|
+
|
|
30376
30382
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
30377
30383
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
30378
30384
|
//
|
|
@@ -30418,7 +30424,7 @@ function getValidNumberFromString(value) {
|
|
|
30418
30424
|
// If the value is not a number, return 0.
|
|
30419
30425
|
return isNaN(parsed) ? 0 : parsed;
|
|
30420
30426
|
}
|
|
30421
|
-
const DEFAULT_COLOR = "
|
|
30427
|
+
const DEFAULT_COLOR = "grayH";
|
|
30422
30428
|
function getDefaultFigureForType(type) {
|
|
30423
30429
|
switch (type) {
|
|
30424
30430
|
case "point":
|
|
@@ -30437,7 +30443,6 @@ function getDefaultFigureForType(type) {
|
|
|
30437
30443
|
})],
|
|
30438
30444
|
color: DEFAULT_COLOR,
|
|
30439
30445
|
lineStyle: "solid",
|
|
30440
|
-
showArrows: false,
|
|
30441
30446
|
showStartPoint: false,
|
|
30442
30447
|
showEndPoint: false
|
|
30443
30448
|
};
|
|
@@ -30586,7 +30591,6 @@ const LockedLineSettings = props => {
|
|
|
30586
30591
|
points,
|
|
30587
30592
|
color: lineColor,
|
|
30588
30593
|
lineStyle = "solid",
|
|
30589
|
-
showArrows,
|
|
30590
30594
|
showStartPoint,
|
|
30591
30595
|
showEndPoint,
|
|
30592
30596
|
onChangeProps,
|
|
@@ -30682,13 +30686,7 @@ const LockedLineSettings = props => {
|
|
|
30682
30686
|
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
30683
30687
|
value: "dashed",
|
|
30684
30688
|
label: "dashed"
|
|
30685
|
-
})))), /*#__PURE__*/React.createElement(
|
|
30686
|
-
label: "show arrows",
|
|
30687
|
-
checked: showArrows,
|
|
30688
|
-
onChange: newValue => onChangeProps({
|
|
30689
|
-
showArrows: newValue
|
|
30690
|
-
})
|
|
30691
|
-
}), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
|
|
30689
|
+
})))), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
|
|
30692
30690
|
label: "Start point",
|
|
30693
30691
|
toggled: showStartPoint
|
|
30694
30692
|
}, startPoint, {
|