@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/index.js
CHANGED
|
@@ -24,10 +24,11 @@ var mathInput = require('@khanacademy/math-input');
|
|
|
24
24
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
25
25
|
var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
|
|
26
26
|
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
27
|
-
var
|
|
27
|
+
var Banner = require('@khanacademy/wonder-blocks-banner');
|
|
28
28
|
var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
|
|
29
29
|
var Button = require('@khanacademy/wonder-blocks-button');
|
|
30
30
|
var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
|
|
31
|
+
var Switch = require('@khanacademy/wonder-blocks-switch');
|
|
31
32
|
|
|
32
33
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
33
34
|
|
|
@@ -59,13 +60,14 @@ var caretRight__default = /*#__PURE__*/_interopDefaultLegacy(caretRight);
|
|
|
59
60
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
60
61
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
61
62
|
var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
|
|
62
|
-
var
|
|
63
|
+
var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
|
|
63
64
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
64
65
|
var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
|
|
66
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
65
67
|
|
|
66
68
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
67
69
|
const libName = "@khanacademy/perseus-editor";
|
|
68
|
-
const libVersion = "6.2.
|
|
70
|
+
const libVersion = "6.2.1";
|
|
69
71
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
70
72
|
|
|
71
73
|
function _extends() {
|
|
@@ -30070,7 +30072,11 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30070
30072
|
onBlur: this.changeBackgroundUrl
|
|
30071
30073
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30072
30074
|
style: styles$k.rulerSection
|
|
30073
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
30075
|
+
}, /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
30076
|
+
layout: "floating",
|
|
30077
|
+
text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
|
|
30078
|
+
kind: "warning"
|
|
30079
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30074
30080
|
style: styles$k.checkboxRow
|
|
30075
30081
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30076
30082
|
label: "Show ruler",
|
|
@@ -30165,7 +30171,8 @@ const styles$k = aphrodite.StyleSheet.create({
|
|
|
30165
30171
|
checkboxRow: {
|
|
30166
30172
|
flexDirection: "row",
|
|
30167
30173
|
alignItems: "center",
|
|
30168
|
-
justifyContent: "space-between"
|
|
30174
|
+
justifyContent: "space-between",
|
|
30175
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
30169
30176
|
},
|
|
30170
30177
|
rulerSection: {
|
|
30171
30178
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -30361,35 +30368,6 @@ const styles$h = aphrodite.StyleSheet.create({
|
|
|
30361
30368
|
}
|
|
30362
30369
|
});
|
|
30363
30370
|
|
|
30364
|
-
const LabeledSwitch = props => {
|
|
30365
|
-
const {
|
|
30366
|
-
checked,
|
|
30367
|
-
label,
|
|
30368
|
-
style,
|
|
30369
|
-
onChange
|
|
30370
|
-
} = props;
|
|
30371
|
-
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30372
|
-
const switchId = ids.get("switch");
|
|
30373
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30374
|
-
style: [styles$g.row, style]
|
|
30375
|
-
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30376
|
-
id: switchId,
|
|
30377
|
-
checked: checked,
|
|
30378
|
-
onChange: onChange
|
|
30379
|
-
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30380
|
-
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30381
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30382
|
-
tag: "label",
|
|
30383
|
-
htmlFor: switchId
|
|
30384
|
-
}, label));
|
|
30385
|
-
};
|
|
30386
|
-
const styles$g = aphrodite.StyleSheet.create({
|
|
30387
|
-
row: {
|
|
30388
|
-
flexDirection: "row",
|
|
30389
|
-
alignItems: "center"
|
|
30390
|
-
}
|
|
30391
|
-
});
|
|
30392
|
-
|
|
30393
30371
|
const LockedFigureSettingsAccordion = props => {
|
|
30394
30372
|
const {
|
|
30395
30373
|
children,
|
|
@@ -30404,14 +30382,14 @@ const LockedFigureSettingsAccordion = props => {
|
|
|
30404
30382
|
, {
|
|
30405
30383
|
className: "locked-figure-accordion"
|
|
30406
30384
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
30407
|
-
style: [styles$
|
|
30408
|
-
headerStyle: styles$
|
|
30385
|
+
style: [styles$g.container, containerStyle],
|
|
30386
|
+
headerStyle: styles$g.accordionHeader,
|
|
30409
30387
|
header: header
|
|
30410
30388
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30411
|
-
style: [styles$
|
|
30389
|
+
style: [styles$g.accordionPanel, panelStyle]
|
|
30412
30390
|
}, children)));
|
|
30413
30391
|
};
|
|
30414
|
-
const styles$
|
|
30392
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
30415
30393
|
container: {
|
|
30416
30394
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
30417
30395
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -30443,16 +30421,16 @@ const LockedFigureSettingsActions = props => {
|
|
|
30443
30421
|
figureAriaLabel
|
|
30444
30422
|
} = props;
|
|
30445
30423
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30446
|
-
style: styles$
|
|
30424
|
+
style: styles$f.container
|
|
30447
30425
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30448
30426
|
startIcon: trashIcon__default["default"],
|
|
30449
30427
|
"aria-label": `Delete ${figureAriaLabel}`,
|
|
30450
30428
|
onClick: onRemove,
|
|
30451
30429
|
kind: "tertiary",
|
|
30452
|
-
style: styles$
|
|
30430
|
+
style: styles$f.deleteButton
|
|
30453
30431
|
}, "Delete"));
|
|
30454
30432
|
};
|
|
30455
|
-
const styles$
|
|
30433
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
30456
30434
|
container: {
|
|
30457
30435
|
width: "100%",
|
|
30458
30436
|
flexDirection: "row",
|
|
@@ -30465,6 +30443,35 @@ const styles$e = aphrodite.StyleSheet.create({
|
|
|
30465
30443
|
}
|
|
30466
30444
|
});
|
|
30467
30445
|
|
|
30446
|
+
const LabeledSwitch = props => {
|
|
30447
|
+
const {
|
|
30448
|
+
checked,
|
|
30449
|
+
label,
|
|
30450
|
+
style,
|
|
30451
|
+
onChange
|
|
30452
|
+
} = props;
|
|
30453
|
+
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30454
|
+
const switchId = ids.get("switch");
|
|
30455
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30456
|
+
style: [styles$e.row, style]
|
|
30457
|
+
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30458
|
+
id: switchId,
|
|
30459
|
+
checked: checked,
|
|
30460
|
+
onChange: onChange
|
|
30461
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30462
|
+
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30463
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30464
|
+
tag: "label",
|
|
30465
|
+
htmlFor: switchId
|
|
30466
|
+
}, label));
|
|
30467
|
+
};
|
|
30468
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
30469
|
+
row: {
|
|
30470
|
+
flexDirection: "row",
|
|
30471
|
+
alignItems: "center"
|
|
30472
|
+
}
|
|
30473
|
+
});
|
|
30474
|
+
|
|
30468
30475
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
30469
30476
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
30470
30477
|
//
|
|
@@ -30510,7 +30517,7 @@ function getValidNumberFromString(value) {
|
|
|
30510
30517
|
// If the value is not a number, return 0.
|
|
30511
30518
|
return isNaN(parsed) ? 0 : parsed;
|
|
30512
30519
|
}
|
|
30513
|
-
const DEFAULT_COLOR = "
|
|
30520
|
+
const DEFAULT_COLOR = "grayH";
|
|
30514
30521
|
function getDefaultFigureForType(type) {
|
|
30515
30522
|
switch (type) {
|
|
30516
30523
|
case "point":
|
|
@@ -30530,7 +30537,6 @@ function getDefaultFigureForType(type) {
|
|
|
30530
30537
|
}],
|
|
30531
30538
|
color: DEFAULT_COLOR,
|
|
30532
30539
|
lineStyle: "solid",
|
|
30533
|
-
showArrows: false,
|
|
30534
30540
|
showStartPoint: false,
|
|
30535
30541
|
showEndPoint: false
|
|
30536
30542
|
};
|
|
@@ -30679,7 +30685,6 @@ const LockedLineSettings = props => {
|
|
|
30679
30685
|
points,
|
|
30680
30686
|
color: lineColor,
|
|
30681
30687
|
lineStyle = "solid",
|
|
30682
|
-
showArrows,
|
|
30683
30688
|
showStartPoint,
|
|
30684
30689
|
showEndPoint,
|
|
30685
30690
|
onChangeProps,
|
|
@@ -30780,13 +30785,7 @@ const LockedLineSettings = props => {
|
|
|
30780
30785
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30781
30786
|
value: "dashed",
|
|
30782
30787
|
label: "dashed"
|
|
30783
|
-
})))), /*#__PURE__*/React__namespace.createElement(
|
|
30784
|
-
label: "show arrows",
|
|
30785
|
-
checked: showArrows,
|
|
30786
|
-
onChange: newValue => onChangeProps({
|
|
30787
|
-
showArrows: newValue
|
|
30788
|
-
})
|
|
30789
|
-
}), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
|
|
30788
|
+
})))), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
|
|
30790
30789
|
label: "Start point",
|
|
30791
30790
|
toggled: showStartPoint
|
|
30792
30791
|
}, startPoint, {
|