@khanacademy/perseus 9.0.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/CHANGELOG.md +12 -0
- package/dist/components/info-tip.d.ts +2 -1
- package/dist/components/input-with-examples.d.ts +1 -1
- package/dist/components/sortable.d.ts +1 -1
- package/dist/es/index.css +3 -5
- package/dist/es/index.js +6 -16
- package/dist/es/index.js.map +1 -1
- package/dist/hint-renderer.d.ts +2 -1
- package/dist/hints-renderer.d.ts +2 -1
- package/dist/index.css +3 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -17
- package/dist/index.js.map +1 -1
- package/dist/item-renderer.d.ts +2 -1
- package/dist/multi-items/multi-renderer.d.ts +2 -1
- package/dist/renderer.d.ts +3 -8
- package/dist/types.d.ts +1 -6
- package/dist/widget-container.d.ts +2 -1
- package/dist/widgets/expression.d.ts +8 -8
- package/dist/widgets/grapher.d.ts +2 -1
- package/dist/widgets/passage-ref.d.ts +2 -1
- package/package.json +2 -2
- package/src/__tests__/renderer.test.tsx +0 -2
- package/src/__tests__/server-item-renderer.test.tsx +2 -4
- package/src/components/info-tip.tsx +3 -4
- package/src/components/input-with-examples.tsx +1 -1
- package/src/components/sortable.tsx +1 -1
- package/src/hint-renderer.tsx +2 -1
- package/src/hints-renderer.tsx +2 -9
- package/src/index.ts +0 -1
- package/src/item-renderer.tsx +2 -7
- package/src/multi-items/multi-renderer.tsx +2 -7
- package/src/renderer.tsx +3 -3
- package/src/server-item-renderer.tsx +0 -1
- package/src/types.ts +1 -8
- package/src/widget-container.tsx +2 -1
- package/src/widgets/__tests__/renderQuestion.tsx +3 -11
- package/src/widgets/expression.tsx +2 -7
- package/src/widgets/grapher.tsx +4 -12
- package/src/widgets/passage-ref.tsx +1 -1
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @khanacademy/perseus
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 9eb50ae1: Removed `LinterContextProps` type. Moved to `@khanacademy/perseus-linter` in a previous release, but wasn't deleted from this package.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- aea86eec: Convert all usages of JSX.LibraryManagedAttributes to WB Core's PropsFor type
|
|
12
|
+
- Updated dependencies [7b11736e]
|
|
13
|
+
- @khanacademy/math-input@10.0.1
|
|
14
|
+
|
|
3
15
|
## 9.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import ReactComponentsInfoTip from "./info-tip/info-tip";
|
|
9
|
-
type
|
|
9
|
+
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
10
|
+
type Props = PropsFor<typeof ReactComponentsInfoTip>;
|
|
10
11
|
type State = {
|
|
11
12
|
didMount: boolean;
|
|
12
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { LinterContextProps } from "
|
|
2
|
+
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
type Props = {
|
|
5
5
|
type: "math" | "text" | "tex";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { LinterContextProps } from "../types";
|
|
3
2
|
import type { Position } from "../util";
|
|
3
|
+
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
4
4
|
export declare enum Layout {
|
|
5
5
|
HORIZONTAL = "horizontal",
|
|
6
6
|
VERTICAL = "vertical"
|
package/dist/es/index.css
CHANGED
|
@@ -3679,7 +3679,7 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
|
|
|
3679
3679
|
outline: none !important;
|
|
3680
3680
|
}
|
|
3681
3681
|
.keypad-input .mq-editable-field .mq-root-block {
|
|
3682
|
-
overflow-x:
|
|
3682
|
+
overflow-x: auto;
|
|
3683
3683
|
}
|
|
3684
3684
|
.keypad-input .mq-editable-field .mq-cursor:not(:only-child),
|
|
3685
3685
|
.keypad-input .mq-editable-field .mq-root-block.mq-hasCursor > .mq-cursor:only-child {
|
|
@@ -3698,12 +3698,11 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
|
|
|
3698
3698
|
margin-left: -1px !important;
|
|
3699
3699
|
margin-right: -1px !important;
|
|
3700
3700
|
opacity: 1 !important;
|
|
3701
|
-
transition: opacity
|
|
3701
|
+
transition: opacity 300ms ease !important;
|
|
3702
3702
|
visibility: visible !important;
|
|
3703
3703
|
}
|
|
3704
3704
|
.keypad-input .mq-editable-field .mq-cursor.mq-blink {
|
|
3705
3705
|
opacity: 0 !important;
|
|
3706
|
-
transition: opacity 500ms ease-in !important;
|
|
3707
3706
|
visibility: visible !important;
|
|
3708
3707
|
}
|
|
3709
3708
|
.keypad-input .mq-editable-field .mq-non-leaf .mq-cursor:only-child {
|
|
@@ -3712,12 +3711,11 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
|
|
|
3712
3711
|
border-radius: 1px;
|
|
3713
3712
|
opacity: 1 !important;
|
|
3714
3713
|
padding: 0 4px 0 4px;
|
|
3715
|
-
transition: border-color
|
|
3714
|
+
transition: border-color 300ms ease !important;
|
|
3716
3715
|
}
|
|
3717
3716
|
.keypad-input .mq-editable-field .mq-non-leaf .mq-cursor:only-child.mq-blink {
|
|
3718
3717
|
border-color: #1865f2 !important;
|
|
3719
3718
|
opacity: 1 !important;
|
|
3720
|
-
transition: border-color 500ms ease-in !important;
|
|
3721
3719
|
}
|
|
3722
3720
|
.keypad-input .mq-empty {
|
|
3723
3721
|
background: transparent !important;
|
package/dist/es/index.js
CHANGED
|
@@ -19220,8 +19220,8 @@ class Renderer extends React.Component {
|
|
|
19220
19220
|
|
|
19221
19221
|
// @ts-expect-error - TS2564 - Property 'widgetIds' has no initializer and is not definitely assigned in the constructor.
|
|
19222
19222
|
|
|
19223
|
-
constructor(_props
|
|
19224
|
-
super(_props
|
|
19223
|
+
constructor(_props) {
|
|
19224
|
+
super(_props);
|
|
19225
19225
|
this._currentFocus = void 0;
|
|
19226
19226
|
this._foundTextNodes = void 0;
|
|
19227
19227
|
this._interactionTrackers = void 0;
|
|
@@ -44308,13 +44308,9 @@ class HintsRenderer extends React.Component {
|
|
|
44308
44308
|
totalHints: this.props.hints.length,
|
|
44309
44309
|
ref: "hintRenderer" + i,
|
|
44310
44310
|
key: "hintRenderer" + i,
|
|
44311
|
-
apiOptions: apiOptions
|
|
44312
|
-
// @ts-expect-error - TS2339 - Property 'findExternalWidgets' does not exist on type 'Readonly<{ className?: string | undefined; hints: readonly any[]; hintsVisible?: number | undefined; }> & Readonly<{ children?: ReactNode; }>'.
|
|
44313
|
-
,
|
|
44311
|
+
apiOptions: apiOptions,
|
|
44314
44312
|
findExternalWidgets: this.props.findExternalWidgets,
|
|
44315
|
-
linterContext: PerseusLinter.pushContextStack(
|
|
44316
|
-
// @ts-expect-error - TS2339 - Property 'linterContext' does not exist on type 'Readonly<{ className?: string | undefined; hints: readonly any[]; hintsVisible?: number | undefined; }> & Readonly<{ children?: ReactNode; }>'.
|
|
44317
|
-
this.props.linterContext, "hints[" + i + "]")
|
|
44313
|
+
linterContext: PerseusLinter.pushContextStack(this.props.linterContext, "hints[" + i + "]")
|
|
44318
44314
|
});
|
|
44319
44315
|
if (isFinalHelpPage) {
|
|
44320
44316
|
hints.push(renderer);
|
|
@@ -44573,9 +44569,7 @@ class ItemRenderer extends React.Component {
|
|
|
44573
44569
|
}, /*#__PURE__*/React.createElement(HintsRenderer, {
|
|
44574
44570
|
ref: node => this.hintsRenderer = node,
|
|
44575
44571
|
hints: this.props.item.hints,
|
|
44576
|
-
hintsVisible: this.state.hintsVisible
|
|
44577
|
-
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
44578
|
-
,
|
|
44572
|
+
hintsVisible: this.state.hintsVisible,
|
|
44579
44573
|
apiOptions: apiOptions,
|
|
44580
44574
|
linterContext: PerseusLinter.pushContextStack(this.props.linterContext, "hints")
|
|
44581
44575
|
})),
|
|
@@ -45111,9 +45105,7 @@ class ServerItemRenderer extends React.Component {
|
|
|
45111
45105
|
}));
|
|
45112
45106
|
const hintsRenderer = /*#__PURE__*/React.createElement(HintsRenderer, {
|
|
45113
45107
|
hints: this.props.item.hints,
|
|
45114
|
-
hintsVisible: this.props.hintsVisible
|
|
45115
|
-
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
45116
|
-
,
|
|
45108
|
+
hintsVisible: this.props.hintsVisible,
|
|
45117
45109
|
apiOptions: apiOptions,
|
|
45118
45110
|
ref: elem => this.hintsRenderer = elem
|
|
45119
45111
|
});
|
|
@@ -46331,7 +46323,6 @@ class MultiRenderer extends React.Component {
|
|
|
46331
46323
|
// _annotateRendererArray() needs this
|
|
46332
46324
|
ref: null,
|
|
46333
46325
|
makeRenderer: () => /*#__PURE__*/React.createElement(HintsRenderer, _extends({}, this._getRendererProps(), {
|
|
46334
|
-
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
46335
46326
|
findExternalWidgets: findExternalWidgets,
|
|
46336
46327
|
hints: [hint]
|
|
46337
46328
|
}))
|
|
@@ -46497,7 +46488,6 @@ class MultiRenderer extends React.Component {
|
|
|
46497
46488
|
const hintRendererDatas = rendererDatas;
|
|
46498
46489
|
renderers = [...renderers];
|
|
46499
46490
|
renderers.firstN = n => /*#__PURE__*/React.createElement(HintsRenderer, _extends({}, this._getRendererProps(), {
|
|
46500
|
-
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
46501
46491
|
findExternalWidgets: hintRendererDatas[0] ? hintRendererDatas[0].findExternalWidgets : undefined,
|
|
46502
46492
|
hints: hintRendererDatas.map(d => d.hint),
|
|
46503
46493
|
hintsVisible: n
|