@khanacademy/perseus 6.5.0 → 6.5.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/CHANGELOG.md +7 -0
- package/dist/es/index.css +24 -21
- package/dist/es/index.js +7 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +24 -21
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/interaction-tracker.d.ts +3 -3
- package/dist/interaction-tracker.js.flow +4 -2
- package/dist/perseus-api.d.ts +5 -1
- package/dist/perseus-api.js.flow +7 -1
- package/dist/server-item-renderer.js.flow +4 -4
- package/dist/types.d.ts +5 -1
- package/dist/types.js.flow +5 -1
- package/dist/widgets/radio/choice.js.flow +1 -4
- package/package.json +1 -1
- package/src/interaction-tracker.ts +4 -3
- package/src/styles/widgets/passage.less +37 -28
- package/src/types.ts +9 -1
- package/src/widgets/__stories__/passage-ref.stories.tsx +18 -7
- package/src/widgets/__stories__/passage.stories.tsx +16 -3
- package/src/widgets/__tests__/__snapshots__/passage-ref.test.ts.snap +6 -6
- package/src/widgets/__tests__/__snapshots__/passage.test.tsx.snap +12 -12
- package/src/widgets/passage.tsx +13 -2
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.css
CHANGED
|
@@ -3181,54 +3181,57 @@ body.mobile .perseus-matrix .math-output {
|
|
|
3181
3181
|
.orderer.layout-vertical .draggable-box .placeholder {
|
|
3182
3182
|
box-sizing: border-box;
|
|
3183
3183
|
}
|
|
3184
|
-
|
|
3184
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] {
|
|
3185
3185
|
line-height: 20px;
|
|
3186
3186
|
margin: 22px;
|
|
3187
3187
|
position: relative;
|
|
3188
3188
|
}
|
|
3189
|
-
|
|
3189
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] div.paragraph {
|
|
3190
3190
|
font-family: "minion-pro", KaTeX_Main, Times, "Times New Roman", serif;
|
|
3191
3191
|
}
|
|
3192
|
-
|
|
3193
|
-
line-height: 18px;
|
|
3194
|
-
}
|
|
3195
|
-
.perseus-widget-passage-container .passage-title div.paragraph {
|
|
3192
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] .passage-title div.paragraph {
|
|
3196
3193
|
font-family: "Noto Serif", serif;
|
|
3197
3194
|
font-weight: 700;
|
|
3198
3195
|
font-size: 20px;
|
|
3199
3196
|
line-height: 22px;
|
|
3200
3197
|
margin: 0 0 10px;
|
|
3201
3198
|
}
|
|
3202
|
-
|
|
3199
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] .passage-text div.paragraph {
|
|
3203
3200
|
font-weight: 400;
|
|
3204
3201
|
font-size: 16px;
|
|
3205
3202
|
line-height: 20px;
|
|
3206
3203
|
text-indent: 20px;
|
|
3207
3204
|
margin: 0;
|
|
3208
3205
|
}
|
|
3209
|
-
|
|
3206
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] .passage-text div.paragraph span {
|
|
3210
3207
|
text-indent: 0;
|
|
3211
3208
|
}
|
|
3212
|
-
|
|
3209
|
+
[id^="perseus-widget-passage-container"] [id^="perseus-widget-passage"] .passage-text div.paragraph em {
|
|
3210
|
+
line-height: 0;
|
|
3211
|
+
}
|
|
3212
|
+
[id^="perseus-widget-passage-container"] .katex {
|
|
3213
|
+
line-height: 18px;
|
|
3214
|
+
}
|
|
3215
|
+
[id^="perseus-widget-passage-container"] .footnotes {
|
|
3213
3216
|
margin-top: 22px;
|
|
3214
3217
|
}
|
|
3215
|
-
|
|
3218
|
+
[id^="perseus-widget-passage-container"] .footnotes div.paragraph {
|
|
3216
3219
|
font-size: 14px;
|
|
3217
3220
|
margin: 0;
|
|
3218
3221
|
}
|
|
3219
|
-
|
|
3220
|
-
background-color: #
|
|
3222
|
+
[id^="perseus-widget-passage-container"] .perseus-highlight {
|
|
3223
|
+
background-color: #fffabe;
|
|
3221
3224
|
}
|
|
3222
|
-
|
|
3223
|
-
background-color: #
|
|
3225
|
+
[id^="perseus-widget-passage-container"] .perseus-review-highlight {
|
|
3226
|
+
background-color: #eee7b2;
|
|
3224
3227
|
}
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
+
[id^="perseus-widget-passage-container"] .perseus-passage-square-label,
|
|
3229
|
+
[id^="perseus-widget-passage-container"] .perseus-passage-circle-label,
|
|
3230
|
+
[id^="perseus-widget-passage-container"] .perseus-passage-bracket-label {
|
|
3228
3231
|
font-family: Times, "Times New Roman", serif;
|
|
3229
3232
|
font-size: 16px;
|
|
3230
3233
|
}
|
|
3231
|
-
|
|
3234
|
+
[id^="perseus-widget-passage-container"] .line-numbers {
|
|
3232
3235
|
font-size: 12px;
|
|
3233
3236
|
font-style: italic;
|
|
3234
3237
|
font-weight: 600;
|
|
@@ -3240,15 +3243,15 @@ body.mobile .perseus-matrix .math-output {
|
|
|
3240
3243
|
left: -52px;
|
|
3241
3244
|
width: 37px;
|
|
3242
3245
|
}
|
|
3243
|
-
|
|
3246
|
+
[id^="perseus-widget-passage-container"] .line-numbers span {
|
|
3244
3247
|
display: block;
|
|
3245
3248
|
line-height: 20px;
|
|
3246
3249
|
position: relative;
|
|
3247
3250
|
top: 2px;
|
|
3248
3251
|
visibility: hidden;
|
|
3249
3252
|
}
|
|
3250
|
-
|
|
3251
|
-
|
|
3253
|
+
[id^="perseus-widget-passage-container"] .line-numbers span:nth-of-type(5n),
|
|
3254
|
+
[id^="perseus-widget-passage-container"] .line-numbers .line-marker {
|
|
3252
3255
|
visibility: visible;
|
|
3253
3256
|
}
|
|
3254
3257
|
.perseus-widget-passage-editor .perseus-single-editor {
|
package/dist/es/index.js
CHANGED
|
@@ -17702,9 +17702,7 @@ class InteractionTracker {
|
|
|
17702
17702
|
|
|
17703
17703
|
// @ts-expect-error [FEI-5003] - TS2564 - Property 'widgetType' has no initializer and is not definitely assigned in the constructor.
|
|
17704
17704
|
|
|
17705
|
-
constructor(trackApi,
|
|
17706
|
-
// original apiOptions.trackInteraction
|
|
17707
|
-
widgetType, widgetID, setting // "" means track once
|
|
17705
|
+
constructor(trackApi, widgetType, widgetID, setting // "" means track once
|
|
17708
17706
|
) {
|
|
17709
17707
|
this._tracked = void 0;
|
|
17710
17708
|
this.setting = void 0;
|
|
@@ -37976,10 +37974,11 @@ class Passage extends React.Component {
|
|
|
37976
37974
|
const parsedContent = PassageMarkdown.parse(doubleQuoteParsedContent, parseState);
|
|
37977
37975
|
// Check if the title has any non-empty text in it.
|
|
37978
37976
|
const hasTitle = /\S/.test(this.props.passageTitle);
|
|
37977
|
+
const joinedTitle = joinString(this.props.passageTitle);
|
|
37979
37978
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
37980
|
-
|
|
37979
|
+
id: "perseus-widget-passage-container" + joinedTitle
|
|
37981
37980
|
}, this._renderInstructions(parseState), /*#__PURE__*/React.createElement("div", {
|
|
37982
|
-
|
|
37981
|
+
id: "perseus-widget-passage" + joinedTitle
|
|
37983
37982
|
}, hasTitle && /*#__PURE__*/React.createElement("h3", {
|
|
37984
37983
|
className: "passage-title"
|
|
37985
37984
|
}, /*#__PURE__*/React.createElement(Renderer, {
|
|
@@ -38010,6 +38009,8 @@ class Passage extends React.Component {
|
|
|
38010
38009
|
}, i18n._("End of reading passage.")))));
|
|
38011
38010
|
}
|
|
38012
38011
|
}
|
|
38012
|
+
|
|
38013
|
+
// That's All, Folks! => -thats-all-folks
|
|
38013
38014
|
Passage.defaultProps = {
|
|
38014
38015
|
passageTitle: "",
|
|
38015
38016
|
passageText: "",
|
|
@@ -38018,6 +38019,7 @@ Passage.defaultProps = {
|
|
|
38018
38019
|
highlights: {},
|
|
38019
38020
|
linterContext: linterContextDefault
|
|
38020
38021
|
};
|
|
38022
|
+
const joinString = title => "-" + title.toLowerCase().replace(/[^\w\s]/gi, "").trim().split(/\s+/).join("-");
|
|
38021
38023
|
var Passage$1 = {
|
|
38022
38024
|
name: "passage",
|
|
38023
38025
|
displayName: "Passage (SAT only)",
|