hyperbook 0.55.0 → 0.57.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.
Files changed (48) hide show
  1. package/dist/assets/directive-alert/style.css +9 -0
  2. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/a11y/assistive-mml.js +1 -0
  3. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/a11y/semantic-enrich.js +1 -0
  4. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/a11y/sre.js +1 -0
  5. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_AMS-Regular.woff +0 -0
  6. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Calligraphic-Bold.woff +0 -0
  7. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Calligraphic-Regular.woff +0 -0
  8. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Fraktur-Bold.woff +0 -0
  9. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Fraktur-Regular.woff +0 -0
  10. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Main-Bold.woff +0 -0
  11. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Main-Italic.woff +0 -0
  12. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Main-Regular.woff +0 -0
  13. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Math-BoldItalic.woff +0 -0
  14. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Math-Italic.woff +0 -0
  15. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Math-Regular.woff +0 -0
  16. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_SansSerif-Bold.woff +0 -0
  17. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_SansSerif-Italic.woff +0 -0
  18. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_SansSerif-Regular.woff +0 -0
  19. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Script-Regular.woff +0 -0
  20. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Size1-Regular.woff +0 -0
  21. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Size2-Regular.woff +0 -0
  22. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Size3-Regular.woff +0 -0
  23. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Size4-Regular.woff +0 -0
  24. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Typewriter-Regular.woff +0 -0
  25. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Vector-Bold.woff +0 -0
  26. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Vector-Regular.woff +0 -0
  27. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/fonts/MathJax_Zero.woff +0 -0
  28. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/h5p-math-display.js +1 -0
  29. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/input/mml.js +1 -0
  30. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/mathjax.js +2 -0
  31. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/mathjax.js.LICENSE.txt +32 -0
  32. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/base.json +29 -0
  33. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/ca.json +140 -0
  34. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/da.json +140 -0
  35. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/de.json +146 -0
  36. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/en.json +158 -0
  37. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/es.json +140 -0
  38. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/fr.json +146 -0
  39. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/hi.json +146 -0
  40. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/it.json +146 -0
  41. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/nb.json +146 -0
  42. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/nemeth.json +125 -0
  43. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/nn.json +146 -0
  44. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/dist/sre/mathmaps/sv.json +146 -0
  45. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/h5p-math-display.css +6 -0
  46. package/dist/assets/directive-h5p/libraries/H5P.MathDisplay-1.0/library.json +36 -0
  47. package/dist/index.js +143 -48
  48. package/package.json +4 -4
@@ -0,0 +1,6 @@
1
+ /* Avoid the assistive mml overflowing the element,
2
+ to e.g. avoid unneccessary scrollbars inside CP */
3
+ mjx-assistive-mml {
4
+ right: 0;
5
+ bottom: 0;
6
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "machineName": "H5P.MathDisplay",
3
+ "title": "MathDisplay",
4
+ "description": "Allows to use LaTeX.",
5
+ "license": "MIT",
6
+ "author": "Joubel",
7
+ "majorVersion": 1,
8
+ "minorVersion": 0,
9
+ "patchVersion": 33,
10
+ "runnable": 0,
11
+ "coreApi": {
12
+ "majorVersion": 1,
13
+ "minorVersion": 19
14
+ },
15
+ "preloadedJs": [
16
+ {
17
+ "path": "dist/h5p-math-display.js"
18
+ }
19
+ ],
20
+ "preloadedCss": [
21
+ {
22
+ "path": "h5p-math-display.css"
23
+ }
24
+ ],
25
+ "addTo": {
26
+ "content": {
27
+ "types": [
28
+ {
29
+ "text": {
30
+ "regex": "/\\$\\$.+\\$\\$|\\\\\\[.+\\\\\\]|\\\\\\(.+\\\\\\)/"
31
+ }
32
+ }
33
+ ]
34
+ }
35
+ }
36
+ }
package/dist/index.js CHANGED
@@ -100766,7 +100766,25 @@ var getMarkdown = async (file) => {
100766
100766
  );
100767
100767
  const template = import_handlebars.default.compile(snippetFile);
100768
100768
  const vars = {
100769
- hyperbook
100769
+ hyperbook,
100770
+ c: dots,
100771
+ // same level
100772
+ c1: dots + ":",
100773
+ // one more colon
100774
+ c2: dots + "::",
100775
+ // two more colons
100776
+ c3: dots + ":::",
100777
+ // three more colons
100778
+ c4: dots + "::::",
100779
+ // four more colons
100780
+ l1: dots.length > 1 ? dots.slice(1) : ":",
100781
+ // one less colon (l = less)
100782
+ l2: dots.length > 2 ? dots.slice(2) : ":",
100783
+ // two less colons
100784
+ l3: dots.length > 3 ? dots.slice(3) : ":",
100785
+ // three less colons
100786
+ l4: dots.length > 4 ? dots.slice(4) : ":"
100787
+ // four less colons
100770
100788
  };
100771
100789
  for (const m of snippet[4].match(/(?:[^\s"]+|"[^"]*")+/g) || []) {
100772
100790
  const r = varReg.exec(m);
@@ -118935,15 +118953,15 @@ var dist_require_source_map_consumer = dist_commonJS({
118935
118953
  if (typeof aSourceMap === "string") {
118936
118954
  sourceMap = util.parseSourceMapInput(aSourceMap);
118937
118955
  }
118938
- var version2 = util.getArg(sourceMap, "version");
118956
+ var version3 = util.getArg(sourceMap, "version");
118939
118957
  var sources = util.getArg(sourceMap, "sources");
118940
118958
  var names = util.getArg(sourceMap, "names", []);
118941
118959
  var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
118942
118960
  var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
118943
118961
  var mappings = util.getArg(sourceMap, "mappings");
118944
118962
  var file = util.getArg(sourceMap, "file", null);
118945
- if (version2 != this._version) {
118946
- throw new Error("Unsupported version: " + version2);
118963
+ if (version3 != this._version) {
118964
+ throw new Error("Unsupported version: " + version3);
118947
118965
  }
118948
118966
  if (sourceRoot) {
118949
118967
  sourceRoot = util.normalize(sourceRoot);
@@ -119248,10 +119266,10 @@ var dist_require_source_map_consumer = dist_commonJS({
119248
119266
  if (typeof aSourceMap === "string") {
119249
119267
  sourceMap = util.parseSourceMapInput(aSourceMap);
119250
119268
  }
119251
- var version2 = util.getArg(sourceMap, "version");
119269
+ var version3 = util.getArg(sourceMap, "version");
119252
119270
  var sections = util.getArg(sourceMap, "sections");
119253
- if (version2 != this._version) {
119254
- throw new Error("Unsupported version: " + version2);
119271
+ if (version3 != this._version) {
119272
+ throw new Error("Unsupported version: " + version3);
119255
119273
  }
119256
119274
  this._sources = new ArraySet();
119257
119275
  this._names = new ArraySet();
@@ -132164,7 +132182,7 @@ function closedDialog(node3) {
132164
132182
  return node3.tagName === "dialog" && !(node3.properties || {}).open;
132165
132183
  }
132166
132184
 
132167
- // ../../node_modules/.pnpm/katex@0.16.11/node_modules/katex/dist/katex.mjs
132185
+ // ../../node_modules/.pnpm/katex@0.16.22/node_modules/katex/dist/katex.mjs
132168
132186
  var SourceLocation = class _SourceLocation {
132169
132187
  // The + prefix indicates that these fields aren't writeable
132170
132188
  // Lexer holding the input string.
@@ -135580,6 +135598,7 @@ var toNode = function toNode2(tagName) {
135580
135598
  }
135581
135599
  return node3;
135582
135600
  };
135601
+ var invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
135583
135602
  var toMarkup = function toMarkup2(tagName) {
135584
135603
  var markup = "<" + tagName;
135585
135604
  if (this.classes.length) {
@@ -135596,6 +135615,9 @@ var toMarkup = function toMarkup2(tagName) {
135596
135615
  }
135597
135616
  for (var attr in this.attributes) {
135598
135617
  if (this.attributes.hasOwnProperty(attr)) {
135618
+ if (invalidAttributeNameRegex.test(attr)) {
135619
+ throw new ParseError("Invalid attribute name '" + attr + "'");
135620
+ }
135599
135621
  markup += " " + attr + '="' + utils.escape(this.attributes[attr]) + '"';
135600
135622
  }
135601
135623
  }
@@ -136486,6 +136508,7 @@ defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
136486
136508
  defineSymbol(math, main, inner, "\u22EF", "\\@cdots", true);
136487
136509
  defineSymbol(math, main, inner, "\u22F1", "\\ddots", true);
136488
136510
  defineSymbol(math, main, textord, "\u22EE", "\\varvdots");
136511
+ defineSymbol(dist_text, main, textord, "\u22EE", "\\varvdots");
136489
136512
  defineSymbol(math, main, accent, "\u02CA", "\\acute");
136490
136513
  defineSymbol(math, main, accent, "\u02CB", "\\grave");
136491
136514
  defineSymbol(math, main, accent, "\xA8", "\\ddot");
@@ -137116,6 +137139,10 @@ var fontMap = {
137116
137139
  variant: "italic",
137117
137140
  fontName: "Math-Italic"
137118
137141
  },
137142
+ "mathsfit": {
137143
+ variant: "sans-serif-italic",
137144
+ fontName: "SansSerif-Italic"
137145
+ },
137119
137146
  // "boldsymbol" is missing because they require the use of multiple fonts:
137120
137147
  // Math-BoldItalic and Main-Bold. This is handled by a special case in
137121
137148
  // makeOrd which ends up calling boldsymbol.
@@ -137602,7 +137629,15 @@ var MathNode = class {
137602
137629
  node3.className = createClass(this.classes);
137603
137630
  }
137604
137631
  for (var i = 0; i < this.children.length; i++) {
137605
- node3.appendChild(this.children[i].toNode());
137632
+ if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {
137633
+ var text9 = this.children[i].toText() + this.children[++i].toText();
137634
+ while (this.children[i + 1] instanceof TextNode) {
137635
+ text9 += this.children[++i].toText();
137636
+ }
137637
+ node3.appendChild(new TextNode(text9).toNode());
137638
+ } else {
137639
+ node3.appendChild(this.children[i].toNode());
137640
+ }
137606
137641
  }
137607
137642
  return node3;
137608
137643
  }
@@ -137774,6 +137809,8 @@ var getVariant = function getVariant2(group, options) {
137774
137809
  return "bold";
137775
137810
  } else if (font === "mathbb") {
137776
137811
  return "double-struck";
137812
+ } else if (font === "mathsfit") {
137813
+ return "sans-serif-italic";
137777
137814
  } else if (font === "mathfrak") {
137778
137815
  return "fraktur";
137779
137816
  } else if (font === "mathscr" || font === "mathcal") {
@@ -137796,6 +137833,20 @@ var getVariant = function getVariant2(group, options) {
137796
137833
  }
137797
137834
  return null;
137798
137835
  };
137836
+ function isNumberPunctuation(group) {
137837
+ if (!group) {
137838
+ return false;
137839
+ }
137840
+ if (group.type === "mi" && group.children.length === 1) {
137841
+ var child = group.children[0];
137842
+ return child instanceof TextNode && child.text === ".";
137843
+ } else if (group.type === "mo" && group.children.length === 1 && group.getAttribute("separator") === "true" && group.getAttribute("lspace") === "0em" && group.getAttribute("rspace") === "0em") {
137844
+ var _child = group.children[0];
137845
+ return _child instanceof TextNode && _child.text === ",";
137846
+ } else {
137847
+ return false;
137848
+ }
137849
+ }
137799
137850
  var buildExpression2 = function buildExpression3(expression, options, isOrdgroup) {
137800
137851
  if (expression.length === 1) {
137801
137852
  var group = buildGroup2(expression[0], options);
@@ -137816,18 +137867,24 @@ var buildExpression2 = function buildExpression3(expression, options, isOrdgroup
137816
137867
  } else if (_group.type === "mn" && lastGroup.type === "mn") {
137817
137868
  lastGroup.children.push(..._group.children);
137818
137869
  continue;
137819
- } else if (_group.type === "mi" && _group.children.length === 1 && lastGroup.type === "mn") {
137820
- var child = _group.children[0];
137821
- if (child instanceof TextNode && child.text === ".") {
137822
- lastGroup.children.push(..._group.children);
137823
- continue;
137870
+ } else if (isNumberPunctuation(_group) && lastGroup.type === "mn") {
137871
+ lastGroup.children.push(..._group.children);
137872
+ continue;
137873
+ } else if (_group.type === "mn" && isNumberPunctuation(lastGroup)) {
137874
+ _group.children = [...lastGroup.children, ..._group.children];
137875
+ groups.pop();
137876
+ } else if ((_group.type === "msup" || _group.type === "msub") && _group.children.length >= 1 && (lastGroup.type === "mn" || isNumberPunctuation(lastGroup))) {
137877
+ var base2 = _group.children[0];
137878
+ if (base2 instanceof MathNode && base2.type === "mn") {
137879
+ base2.children = [...lastGroup.children, ...base2.children];
137880
+ groups.pop();
137824
137881
  }
137825
137882
  } else if (lastGroup.type === "mi" && lastGroup.children.length === 1) {
137826
137883
  var lastChild = lastGroup.children[0];
137827
137884
  if (lastChild instanceof TextNode && lastChild.text === "\u0338" && (_group.type === "mo" || _group.type === "mi" || _group.type === "mn")) {
137828
- var _child = _group.children[0];
137829
- if (_child instanceof TextNode && _child.text.length > 0) {
137830
- _child.text = _child.text.slice(0, 1) + "\u0338" + _child.text.slice(1);
137885
+ var child = _group.children[0];
137886
+ if (child instanceof TextNode && child.text.length > 0) {
137887
+ child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
137831
137888
  groups.pop();
137832
137889
  }
137833
137890
  }
@@ -141266,6 +141323,7 @@ defineFunction({
141266
141323
  "\\mathit",
141267
141324
  "\\mathbf",
141268
141325
  "\\mathnormal",
141326
+ "\\mathsfit",
141269
141327
  // families
141270
141328
  "\\mathbb",
141271
141329
  "\\mathcal",
@@ -143116,7 +143174,8 @@ defineFunction({
143116
143174
  names: ["\\relax"],
143117
143175
  props: {
143118
143176
  numArgs: 0,
143119
- allowedInText: true
143177
+ allowedInText: true,
143178
+ allowedInArgument: true
143120
143179
  },
143121
143180
  handler(_ref) {
143122
143181
  var {
@@ -143134,6 +143193,8 @@ defineFunction({
143134
143193
  props: {
143135
143194
  numArgs: 2,
143136
143195
  numOptionalArgs: 1,
143196
+ allowedInText: true,
143197
+ allowedInMath: true,
143137
143198
  argTypes: ["size", "size", "size"]
143138
143199
  },
143139
143200
  handler(_ref, args, optArgs) {
@@ -144252,7 +144313,7 @@ defineMacro("\\char", function(context) {
144252
144313
  }
144253
144314
  return "\\@char{" + number4 + "}";
144254
144315
  });
144255
- var newcommand = (context, existsOK, nonexistsOK) => {
144316
+ var newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {
144256
144317
  var arg = context.consumeArg().tokens;
144257
144318
  if (arg.length !== 1) {
144258
144319
  throw new ParseError("\\newcommand's first argument must be a macro name");
@@ -144280,15 +144341,17 @@ var newcommand = (context, existsOK, nonexistsOK) => {
144280
144341
  numArgs = parseInt(argText);
144281
144342
  arg = context.consumeArg().tokens;
144282
144343
  }
144283
- context.macros.set(name, {
144284
- tokens: arg,
144285
- numArgs
144286
- });
144344
+ if (!(exists && skipIfExists)) {
144345
+ context.macros.set(name, {
144346
+ tokens: arg,
144347
+ numArgs
144348
+ });
144349
+ }
144287
144350
  return "";
144288
144351
  };
144289
- defineMacro("\\newcommand", (context) => newcommand(context, false, true));
144290
- defineMacro("\\renewcommand", (context) => newcommand(context, true, false));
144291
- defineMacro("\\providecommand", (context) => newcommand(context, true, true));
144352
+ defineMacro("\\newcommand", (context) => newcommand(context, false, true, false));
144353
+ defineMacro("\\renewcommand", (context) => newcommand(context, true, false, false));
144354
+ defineMacro("\\providecommand", (context) => newcommand(context, true, true, true));
144292
144355
  defineMacro("\\message", (context) => {
144293
144356
  var arg = context.consumeArgs(1)[0];
144294
144357
  console.log(arg.reverse().map((token) => token.text).join(""));
@@ -144360,7 +144423,7 @@ defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
144360
144423
  defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
144361
144424
  defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
144362
144425
  defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
144363
- defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
144426
+ defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
144364
144427
  defineMacro("\u22EE", "\\vdots");
144365
144428
  defineMacro("\\varGamma", "\\mathit{\\Gamma}");
144366
144429
  defineMacro("\\varDelta", "\\mathit{\\Delta}");
@@ -144379,6 +144442,8 @@ defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
144379
144442
  defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
144380
144443
  defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
144381
144444
  defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
144445
+ defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
144446
+ defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
144382
144447
  var dotsByToken = {
144383
144448
  ",": "\\dotsc",
144384
144449
  "\\not": "\\dotsb",
@@ -145864,7 +145929,11 @@ var Parser2 = class _Parser {
145864
145929
  var symbol = symbolToken.text;
145865
145930
  this.consume();
145866
145931
  this.consumeSpaces();
145867
- var group = this.parseGroup(name);
145932
+ var group;
145933
+ do {
145934
+ var _group;
145935
+ group = this.parseGroup(name);
145936
+ } while (((_group = group) == null ? void 0 : _group.type) === "internal");
145868
145937
  if (!group) {
145869
145938
  throw new ParseError("Expected group after '" + symbol + "'", symbolToken);
145870
145939
  }
@@ -145901,6 +145970,9 @@ var Parser2 = class _Parser {
145901
145970
  */
145902
145971
  parseAtom(breakOnTokenText) {
145903
145972
  var base2 = this.parseGroup("atom", breakOnTokenText);
145973
+ if ((base2 == null ? void 0 : base2.type) === "internal") {
145974
+ return base2;
145975
+ }
145904
145976
  if (this.mode === "text") {
145905
145977
  return base2;
145906
145978
  }
@@ -146112,11 +146184,11 @@ var Parser2 = class _Parser {
146112
146184
  if (optional) {
146113
146185
  throw new ParseError("A primitive argument cannot be optional");
146114
146186
  }
146115
- var _group = this.parseGroup(name);
146116
- if (_group == null) {
146187
+ var _group2 = this.parseGroup(name);
146188
+ if (_group2 == null) {
146117
146189
  throw new ParseError("Expected group as " + name, this.fetch());
146118
146190
  }
146119
- return _group;
146191
+ return _group2;
146120
146192
  }
146121
146193
  case "original":
146122
146194
  case null:
@@ -146544,11 +146616,20 @@ var renderToHTMLTree = function renderToHTMLTree2(expression, options) {
146544
146616
  return renderError(error, expression, settings);
146545
146617
  }
146546
146618
  };
146619
+ var dist_version = "0.16.22";
146620
+ var __domTree = {
146621
+ Span,
146622
+ Anchor,
146623
+ SymbolNode,
146624
+ SvgNode,
146625
+ PathNode,
146626
+ LineNode
146627
+ };
146547
146628
  var katex = {
146548
146629
  /**
146549
146630
  * Current KaTeX version
146550
146631
  */
146551
- version: "0.16.11",
146632
+ version: dist_version,
146552
146633
  /**
146553
146634
  * Renders the given LaTeX into an HTML+MathML combination, and adds
146554
146635
  * it as a child to the specified DOM node.
@@ -146564,7 +146645,7 @@ var katex = {
146564
146645
  */
146565
146646
  ParseError,
146566
146647
  /**
146567
- * The shema of Settings
146648
+ * The schema of Settings
146568
146649
  */
146569
146650
  SETTINGS_SCHEMA,
146570
146651
  /**
@@ -146616,18 +146697,11 @@ var katex = {
146616
146697
  /**
146617
146698
  * Expose the dom tree node types, which can be useful for type checking nodes.
146618
146699
  *
146619
- * NOTE: This method is not currently recommended for public use.
146700
+ * NOTE: These methods are not currently recommended for public use.
146620
146701
  * The internal tree representation is unstable and is very likely
146621
146702
  * to change. Use at your own risk.
146622
146703
  */
146623
- __domTree: {
146624
- Span,
146625
- Anchor,
146626
- SymbolNode,
146627
- SvgNode,
146628
- PathNode,
146629
- LineNode
146630
- }
146704
+ __domTree
146631
146705
  };
146632
146706
 
146633
146707
  // ../../node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js
@@ -154015,10 +154089,10 @@ async function resolveThemes(themes) {
154015
154089
  }
154016
154090
  var _emitDeprecation = 3;
154017
154091
  var _emitError = false;
154018
- function warnDeprecated(message, version2 = 3) {
154092
+ function warnDeprecated(message, version3 = 3) {
154019
154093
  if (!_emitDeprecation)
154020
154094
  return;
154021
- if (typeof _emitDeprecation === "number" && version2 > _emitDeprecation)
154095
+ if (typeof _emitDeprecation === "number" && version3 > _emitDeprecation)
154022
154096
  return;
154023
154097
  if (_emitError) {
154024
154098
  throw new Error(`[SHIKI DEPRECATE]: ${message}`);
@@ -178310,8 +178384,8 @@ var pako = {
178310
178384
  };
178311
178385
 
178312
178386
  // ../../node_modules/.pnpm/js-base64@3.7.7/node_modules/js-base64/base64.mjs
178313
- var dist_version = "3.7.7";
178314
- var VERSION = dist_version;
178387
+ var version2 = "3.7.7";
178388
+ var VERSION = version2;
178315
178389
  var _hasBuffer = typeof Buffer === "function";
178316
178390
  var _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
178317
178391
  var _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
@@ -178442,7 +178516,7 @@ var extendBuiltins = () => {
178442
178516
  extendUint8Array();
178443
178517
  };
178444
178518
  var gBase64 = {
178445
- version: dist_version,
178519
+ version: version2,
178446
178520
  VERSION,
178447
178521
  atob: _atob,
178448
178522
  atobPolyfill,
@@ -188020,7 +188094,7 @@ pako/dist/pako.esm.mjs:
188020
188094
  //# sourceMappingURL=index.js.map
188021
188095
 
188022
188096
  ;// CONCATENATED MODULE: ./package.json
188023
- const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.55.0","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --no-cache --no-source-map-register && node postbuild.mjs"},"devDependencies":{"@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');
188097
+ const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.57.0","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --no-cache --no-source-map-register && node postbuild.mjs"},"devDependencies":{"@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');
188024
188098
  ;// CONCATENATED MODULE: ./build.ts
188025
188099
 
188026
188100
 
@@ -188053,6 +188127,7 @@ async function runBuildProject(project, rootProject, out, filter) {
188053
188127
  }
188054
188128
  }
188055
188129
  async function runBuild(root, rootProject, basePath, prefix, out, filter) {
188130
+ var _a;
188056
188131
  console.log(`${source.blue(`[${prefix}]`)} Reading hyperbook.json.`);
188057
188132
  const hyperbookJson = await hyperbook_exports.getJson(root);
188058
188133
  if (!basePath && (hyperbookJson === null || hyperbookJson === void 0 ? void 0 : hyperbookJson.basePath)) {
@@ -188276,6 +188351,26 @@ async function runBuild(root, rootProject, basePath, prefix, out, filter) {
188276
188351
  await extract_zip_default()(file.path.absolute, {
188277
188352
  dir: fileOut,
188278
188353
  });
188354
+ // Read and modify h5p.json to ensure MathDisplay dependency is present
188355
+ const h5pJsonPath = external_path_default().join(fileOut, "h5p.json");
188356
+ const h5pJson = JSON.parse(await promises_default().readFile(h5pJsonPath, "utf8"));
188357
+ // Check if H5P.MathDisplay dependency already exists
188358
+ const hasMathDisplay = (_a = h5pJson.preloadedDependencies) === null || _a === void 0 ? void 0 : _a.some((dep) => dep.machineName === "H5P.MathDisplay");
188359
+ // Add MathDisplay dependency if not present
188360
+ if (!hasMathDisplay) {
188361
+ const mathDisplayDependency = {
188362
+ machineName: "H5P.MathDisplay",
188363
+ majorVersion: 1,
188364
+ minorVersion: 0,
188365
+ };
188366
+ // Initialize preloadedDependencies array if it doesn't exist
188367
+ if (!h5pJson.preloadedDependencies) {
188368
+ h5pJson.preloadedDependencies = [];
188369
+ }
188370
+ h5pJson.preloadedDependencies.push(mathDisplayDependency);
188371
+ // Write the modified h5p.json back to file
188372
+ await promises_default().writeFile(h5pJsonPath, JSON.stringify(h5pJson, null, 2));
188373
+ }
188279
188374
  const h5pLibraries = external_path_default().join(assetsOut, "directive-h5p", "libraries");
188280
188375
  await makeDir(h5pLibraries, { recursive: true });
188281
188376
  const files = await promises_default().readdir(fileOut);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbook",
3
- "version": "0.55.0",
3
+ "version": "0.57.0",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",
@@ -53,9 +53,9 @@
53
53
  "tar": "7.4.3",
54
54
  "update-check": "1.5.4",
55
55
  "ws": "^8.18.0",
56
- "@hyperbook/fs": "0.18.3",
57
- "@hyperbook/markdown": "0.31.0",
58
- "@hyperbook/types": "0.15.2"
56
+ "@hyperbook/fs": "0.19.0",
57
+ "@hyperbook/types": "0.15.2",
58
+ "@hyperbook/markdown": "0.33.0"
59
59
  },
60
60
  "scripts": {
61
61
  "version": "pnpm build",