crossnote 0.9.43 → 0.9.45

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 (163) hide show
  1. package/out/cjs/index.cjs +590 -379
  2. package/out/cli/index.cjs +3867 -912
  3. package/out/dependencies/README.md +46 -6
  4. package/out/dependencies/mermaid/mermaid.min.js +1475 -1475
  5. package/out/dependencies/pele/pele.global.js +150 -0
  6. package/out/dependencies/reveal/css/reveal.css +1 -8
  7. package/out/dependencies/reveal/css/theme/beige.css +1 -301
  8. package/out/dependencies/reveal/css/theme/black-contrast.css +1 -0
  9. package/out/dependencies/reveal/css/theme/black.css +1 -294
  10. package/out/dependencies/reveal/css/theme/blood.css +1 -323
  11. package/out/dependencies/reveal/css/theme/dracula.css +1 -0
  12. package/out/dependencies/reveal/css/theme/league.css +1 -303
  13. package/out/dependencies/reveal/css/theme/moon.css +1 -301
  14. package/out/dependencies/reveal/css/theme/night.css +1 -295
  15. package/out/dependencies/reveal/css/theme/serif.css +1 -297
  16. package/out/dependencies/reveal/css/theme/simple.css +1 -297
  17. package/out/dependencies/reveal/css/theme/sky.css +1 -304
  18. package/out/dependencies/reveal/css/theme/solarized.css +1 -298
  19. package/out/dependencies/reveal/css/theme/white-contrast.css +1 -0
  20. package/out/dependencies/reveal/css/theme/white.css +1 -294
  21. package/out/dependencies/reveal/js/reveal.js +39 -8
  22. package/out/dependencies/reveal/plugin/notes/notes.js +970 -1
  23. package/out/esm/index.mjs +604 -393
  24. package/out/server-app/server-app.css +1 -1
  25. package/out/server-app/server-app.js +10 -10
  26. package/out/styles/style-template.css +1 -1
  27. package/out/types/src/custom-markdown-it-features/admonition.d.ts +1 -1
  28. package/out/types/src/custom-markdown-it-features/callout.d.ts +1 -1
  29. package/out/types/src/custom-markdown-it-features/code-fences.d.ts +2 -2
  30. package/out/types/src/custom-markdown-it-features/colon-fenced-code-blocks.d.ts +1 -1
  31. package/out/types/src/custom-markdown-it-features/critic-markup.d.ts +1 -1
  32. package/out/types/src/custom-markdown-it-features/curly-bracket-attributes.d.ts +1 -1
  33. package/out/types/src/custom-markdown-it-features/emoji.d.ts +1 -1
  34. package/out/types/src/custom-markdown-it-features/html5-embed.d.ts +1 -1
  35. package/out/types/src/custom-markdown-it-features/linkify.d.ts +3 -0
  36. package/out/types/src/custom-markdown-it-features/math.d.ts +1 -1
  37. package/out/types/src/custom-markdown-it-features/sourcemap.d.ts +1 -1
  38. package/out/types/src/custom-markdown-it-features/tag.d.ts +1 -1
  39. package/out/types/src/custom-markdown-it-features/widget.d.ts +1 -1
  40. package/out/types/src/custom-markdown-it-features/wikilink.d.ts +1 -1
  41. package/out/types/src/lib/css-for-style.d.ts +1 -0
  42. package/out/types/src/lib/dangerous-urls.d.ts +1 -1
  43. package/out/types/src/lib/json-for-script.d.ts +1 -0
  44. package/out/types/src/lib/pele-bundle.d.ts +2 -0
  45. package/out/types/src/lib/pele.d.ts +14 -0
  46. package/out/types/src/markdown-engine/index.d.ts +8 -1
  47. package/out/types/src/markdown-engine/mathjax-config.d.ts +5 -0
  48. package/out/types/src/markdown-engine/mermaid-polyfill.d.ts +1 -1
  49. package/out/types/src/markdown-engine/page-markers.d.ts +4 -0
  50. package/out/types/src/markdown-engine/pele-export.d.ts +1 -0
  51. package/out/types/src/markdown-engine/presentation-export.d.ts +7 -0
  52. package/out/types/src/markdown-engine/presentation-notes.d.ts +2 -0
  53. package/out/types/src/markdown-engine/sanitize.d.ts +3 -0
  54. package/out/types/src/markdown-engine/toc.d.ts +1 -1
  55. package/out/types/src/markdown-engine/transformer.d.ts +7 -1
  56. package/out/types/src/notebook/index.d.ts +7 -6
  57. package/out/types/src/notebook/types.d.ts +5 -3
  58. package/out/types/src/renderers/pele.d.ts +4 -0
  59. package/out/types/src/webview/components/ContextMenu.d.ts +1 -0
  60. package/out/types/src/webview/lib/mermaid.d.ts +9 -0
  61. package/out/types/src/webview/lib/pele.d.ts +3 -0
  62. package/out/types/src/webview/lib/sanitize.d.ts +1 -0
  63. package/out/types/src/webview/lib/source-text-map.d.ts +2 -1
  64. package/out/types/test/browser/context-menu-harness.d.ts +1 -0
  65. package/out/types/test/browser/context-menu.spec.d.ts +1 -0
  66. package/out/types/test/browser/mathjax-config-sources.spec.d.ts +1 -0
  67. package/out/types/test/browser/mermaid-measure.spec.d.ts +1 -0
  68. package/out/types/test/browser/mermaid-polyfill.spec.d.ts +1 -0
  69. package/out/types/test/browser/mermaid-sanitize.spec.d.ts +1 -0
  70. package/out/types/test/browser/mouse-wheel-zoom.spec.d.ts +1 -0
  71. package/out/types/test/browser/pele.spec.d.ts +1 -0
  72. package/out/types/test/browser/presentation-print.spec.d.ts +1 -0
  73. package/out/types/test/browser/presentation.spec.d.ts +1 -0
  74. package/out/types/test/browser/preview-container-harness.d.ts +1 -0
  75. package/out/types/test/browser/sanitize-stable.spec.d.ts +1 -0
  76. package/out/types/test/browser/scroll-sync.spec.d.ts +1 -0
  77. package/out/types/test/browser/sidebar-position.spec.d.ts +1 -0
  78. package/out/types/test/config-escaping.test.d.ts +1 -0
  79. package/out/types/test/ebook-export.test.d.ts +1 -0
  80. package/out/types/test/ebook-images.test.d.ts +1 -0
  81. package/out/types/test/fixtures/mutating-markup.d.ts +4 -0
  82. package/out/types/test/fixtures/pele-diagrams.d.ts +6 -0
  83. package/out/types/test/fixtures/pele-hostile.d.ts +2 -0
  84. package/out/types/test/front-matter-escaping.test.d.ts +1 -0
  85. package/out/types/test/html5-embed.test.d.ts +1 -0
  86. package/out/types/test/import-fragment-own-headings.test.d.ts +1 -0
  87. package/out/types/test/indented-code-import.test.d.ts +1 -0
  88. package/out/types/test/linkify.test.d.ts +1 -0
  89. package/out/types/test/markdown-export-toc.test.d.ts +1 -0
  90. package/out/types/test/markdown-it.test.d.ts +1 -0
  91. package/out/types/test/mathjax-config-file.test.d.ts +1 -0
  92. package/out/types/test/mathjax-diagram-sources.test.d.ts +1 -0
  93. package/out/types/test/mutation-xss.test.d.ts +1 -0
  94. package/out/types/test/note-trust.test.d.ts +1 -0
  95. package/out/types/test/page-markers.test.d.ts +1 -0
  96. package/out/types/test/pandoc-export-slide-markers.test.d.ts +1 -0
  97. package/out/types/test/pandoc-fragment-import-lines.test.d.ts +1 -0
  98. package/out/types/test/parser-hook-trust.test.d.ts +1 -0
  99. package/out/types/test/pele-diagrams.test.d.ts +1 -0
  100. package/out/types/test/pele-export.test.d.ts +1 -0
  101. package/out/types/test/pele-preview-script.test.d.ts +1 -0
  102. package/out/types/test/pele-renderer.test.d.ts +1 -0
  103. package/out/types/test/pele-vendor.test.d.ts +1 -0
  104. package/out/types/test/presentation-export-script.test.d.ts +1 -0
  105. package/out/types/test/presentation-export.test.d.ts +1 -0
  106. package/out/types/test/presentation-preview-script.test.d.ts +1 -0
  107. package/out/types/test/presentation-slides.test.d.ts +1 -0
  108. package/out/types/test/reveal-vendor.test.d.ts +1 -0
  109. package/out/types/test/sanitize-stable.test.d.ts +1 -0
  110. package/out/types/test/sidebar-toc.test.d.ts +1 -0
  111. package/out/types/test/toc-bracket.test.d.ts +1 -0
  112. package/out/types/test/webview-mermaid-render.test.d.ts +1 -0
  113. package/out/types/test/webview-pele-render.test.d.ts +1 -0
  114. package/out/types/tsconfig.tsbuildinfo +1 -1
  115. package/out/webview/backlinks.css +1 -1
  116. package/out/webview/backlinks.js +4 -4
  117. package/out/webview/graph-view.css +1 -1
  118. package/out/webview/preview.css +1 -1
  119. package/out/webview/preview.js +201 -201
  120. package/package.json +5 -5
  121. package/out/dependencies/reveal/css/print/paper.css +0 -203
  122. package/out/dependencies/reveal/css/print/pdf.css +0 -164
  123. package/out/dependencies/reveal/css/reset.css +0 -30
  124. package/out/dependencies/reveal/css/theme/README.md +0 -21
  125. package/out/dependencies/reveal/lib/css/zenburn.css +0 -80
  126. package/out/dependencies/reveal/lib/font/league-gothic/LICENSE +0 -2
  127. package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.css +0 -10
  128. package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.eot +0 -0
  129. package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.ttf +0 -0
  130. package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.woff +0 -0
  131. package/out/dependencies/reveal/lib/font/source-sans-pro/LICENSE +0 -45
  132. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  133. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
  134. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  135. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  136. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
  137. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  138. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  139. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
  140. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  141. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
  142. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
  143. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
  144. package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro.css +0 -39
  145. package/out/dependencies/reveal/lib/js/classList.js +0 -2
  146. package/out/dependencies/reveal/lib/js/head.min.js +0 -6
  147. package/out/dependencies/reveal/lib/js/html5shiv.js +0 -7
  148. package/out/dependencies/reveal/plugin/multiplex/client.js +0 -13
  149. package/out/dependencies/reveal/plugin/multiplex/index.js +0 -64
  150. package/out/dependencies/reveal/plugin/multiplex/master.js +0 -34
  151. package/out/dependencies/reveal/plugin/multiplex/package.json +0 -19
  152. package/out/dependencies/reveal/plugin/notes/notes.html +0 -792
  153. package/out/dependencies/reveal/plugin/notes/plugin.js +0 -261
  154. package/out/dependencies/reveal/plugin/notes/speaker-view.html +0 -891
  155. package/out/dependencies/reveal/plugin/notes-server/client.js +0 -65
  156. package/out/dependencies/reveal/plugin/notes-server/index.js +0 -69
  157. package/out/dependencies/reveal/plugin/notes-server/notes.html +0 -585
  158. package/out/dependencies/reveal/plugin/print-pdf/print-pdf.js +0 -67
  159. package/out/dependencies/reveal/plugin/search/plugin.js +0 -243
  160. package/out/dependencies/reveal/plugin/search/search.js +0 -7
  161. package/out/dependencies/reveal/plugin/zoom/plugin.js +0 -264
  162. package/out/dependencies/reveal/plugin/zoom/zoom.js +0 -11
  163. package/out/dependencies/reveal/plugin/zoom-js/zoom.js +0 -272
@@ -7,9 +7,9 @@ I managed some of the libraries by myself instead of through npm to reduce the o
7
7
  "font-awesome": "6.4.2", // Download from here: https://fontawesome.com/download
8
8
  // Fontawesome cheatsheet is available here: https://kapeli.com/cheat_sheets/Font_Awesome.docset/Contents/Resources/Documents/index
9
9
  "katex": "v0.19.1", // Only keep the css and fonts files.
10
- "mermaid": "12.3.0", // see "Updating the vendored mermaid bundle" below
10
+ "mermaid": "12.4.1", // see "Updating the vendored mermaid bundle" below
11
11
  // https://www.jsdelivr.com/package/npm/mermaid
12
- "reveal": "4.6.0",
12
+ "reveal": "6.0.2", // see "Updating the vendored reveal.js" below
13
13
 
14
14
  // NOTE: Don't forget to update `dependentLibraryMaterials` in `markdown-engine/index.ts`
15
15
  "vega-embed": "6.23.0", // https://cdn.jsdelivr.net/npm/vega-embed@6.23.0/build/vega-embed.min.js
@@ -18,19 +18,43 @@ I managed some of the libraries by myself instead of through npm to reduce the o
18
18
  "vega-lite": "5.16.1", // https://cdn.jsdelivr.net/npm/vega-lite@5.16.1/build/vega-lite.min.js
19
19
  "vega": "5.25.0", // https://cdn.jsdelivr.net/npm/vega@5.25.0/build/vega.min.js
20
20
 
21
- "wavedrom": "3.3.0" // - https://cdn.jsdelivr.net/npm/wavedrom@3.3.0/wavedrom.min.js
21
+ "wavedrom": "3.3.0", // - https://cdn.jsdelivr.net/npm/wavedrom@3.3.0/wavedrom.min.js
22
+
23
+ // Not an npm dependency: the browser build is vendored, see "Updating the vendored pele bundle" below
24
+ "pele": "1.13.0" // https://cdn.jsdelivr.net/npm/pele@1.13.0/dist/pele.global.js
22
25
  }
23
26
  ```
24
27
 
25
- _Attention_: Need to remove `font: inherit;` from `reveal.css`. Otherwise, `KaTeX` and `MathJax` will have trouble rendering. Also don't forget to add the empty file `none.css`.
28
+ _Attention_: `reveal.css` must not contain a `font: inherit;` rule — it would break `KaTeX`/`MathJax` rendering. reveal.js 6 dist ships without one; keep it that way (guarded by `test/reveal-vendor.test.ts`). Also don't forget the `none.css` theme (a comment-only file — it disables theming).
26
29
 
27
30
  _Attention_: Don't forget to modify the `dependentLibraryMaterials` variable in `markdown-engine.ts`
28
31
 
29
32
  _Attention_: NOTE: We have to disable the `_self = window` line in `prism.js` to make it work with VSCode web extension.
30
33
 
34
+ ## Updating the vendored reveal.js
35
+
36
+ `dependencies/reveal/` holds reveal.js's **official dist files** downloaded from jsDelivr (<https://cdn.jsdelivr.net/npm/reveal.js@<version>/dist/...>), laid out as:
37
+
38
+ | Vendored path | jsDelivr dist path |
39
+ | ----------------------- | ----------------------- |
40
+ | `js/reveal.js` | `dist/reveal.js` |
41
+ | `css/reveal.css` | `dist/reveal.css` |
42
+ | `css/theme/<name>.css` | `dist/theme/<name>.css` |
43
+ | `plugin/notes/notes.js` | `dist/plugin/notes.js` |
44
+
45
+ `css/theme/vscode.css` (maps the deck to VS Code CSS variables) and `css/theme/none.css` are MPE-custom and must be carried over on every update. The dist files are byte-identical to the CDN files — do not reformat them.
46
+
47
+ To update reveal.js:
48
+
49
+ 1. Download the files above from `https://cdn.jsdelivr.net/npm/reveal.js@<new-version>/dist/...` into place (or extract the matching npm tarball).
50
+ 2. Update the `reveal` version in the version list above and the two CDN fallback URLs in `src/markdown-engine/index.ts` (`reveal.js@<version>/dist/reveal.js` and `reveal.js@<version>/dist/theme/`).
51
+ 3. Add a `CHANGELOG.md` entry.
52
+ 4. Check `test/reveal-vendor.test.ts` — it guards the tree (UMD bundle structure, no `font: inherit` in `reveal.css`, theme files ↔ `RevealJsTheme` union, notes plugin present, CDN version match, and no Chromium-116+ API the oldest supported webview lacks).
53
+ 5. Run the browser presentation suite (`pnpm test:browser`) — `test/browser/presentation.spec.ts` drives the real preview container against the vendored reveal.js.
54
+
31
55
  ## Updating the vendored mermaid bundle
32
56
 
33
- `dependencies/mermaid/mermaid.min.js` is mermaid's **official dist build** downloaded from jsDelivr (e.g. <https://cdn.jsdelivr.net/npm/mermaid@12.3.0/dist/mermaid.min.js>). Do **not** re-bundle mermaid locally with esbuild — the committed file must be byte-identical to the CDN file so the `__esbuild_esm_mermaid_nm` IIFE wrapper and the trailing `globalThis["mermaid"] = ...` assignment match what mermaid ships.
57
+ `dependencies/mermaid/mermaid.min.js` is mermaid's **official dist build** downloaded from jsDelivr (e.g. <https://cdn.jsdelivr.net/npm/mermaid@12.4.1/dist/mermaid.min.js>). Do **not** re-bundle mermaid locally with esbuild — the committed file must be byte-identical to the CDN file so the `__esbuild_esm_mermaid_nm` IIFE wrapper and the trailing `globalThis["mermaid"] = ...` assignment match what mermaid ships.
34
58
 
35
59
  To update mermaid:
36
60
 
@@ -38,6 +62,22 @@ To update mermaid:
38
62
  2. `node scripts/update-mermaid-bundle.mjs` — downloads the matching official dist bundle from jsDelivr into `dependencies/mermaid/mermaid.min.js` (uses the version installed in `node_modules`; an explicit version can be passed as an argument). Equivalent to manually downloading `https://cdn.jsdelivr.net/npm/mermaid@<version>/dist/mermaid.min.js` and copying it to `dependencies/mermaid/mermaid.min.js`.
39
63
  3. Update the mermaid version in the CDN fallback script URL in `src/markdown-engine/index.ts` (`mermaid@<version>/dist/mermaid.min.js`).
40
64
  4. Update the version list above and add a `CHANGELOG.md` entry.
41
- 5. Check `test/mermaid-bundle.test.ts` — it fails the bump if the new bundle calls a Chromium-116+ API the oldest supported webview lacks unless `src/markdown-engine/mermaid-polyfill.ts` defines a shim for it.
65
+ 5. Check `test/mermaid-bundle.test.ts` — it fails the bump if the vendored file is not the dist file of the installed mermaid, and if the new bundle calls an API on its list — one newer than the oldest supported webview — unless `src/markdown-engine/mermaid-polyfill.ts` defines a shim for it. An API that is not on the list is not caught: when a diagram fails on an old webview with `X is not a function`, add `X` to the list together with its shim.
42
66
 
43
67
  Note: the `mermaid` npm package itself declares `engines.node >= 22` (recent lines) while crossnote pins Node 18. That is currently harmless — the package is only used for its types (`MermaidConfig`); it is never imported at runtime, and pnpm does not enforce `engines` on install. Do **not** runtime-import `mermaid` from Node code without re-evaluating the Node-18 support floor first.
68
+
69
+ ## Updating the vendored pele bundle
70
+
71
+ `dependencies/pele/pele.global.js` is pele's **official browser build** downloaded from jsDelivr (<https://cdn.jsdelivr.net/npm/pele@1.13.0/dist/pele.global.js>; the same bytes as `dist/pele.global.js` in the npm package). It is a classic script that defines the global `pele`. Do **not** re-bundle pele locally with esbuild: the file is loaded by a `<script>` tag in the preview and in exported documents, and is evaluated as a script by the Node-side renderer (`src/renderers/pele.ts`), which both depend on it staying what pele ships.
72
+
73
+ `pele` is deliberately not an npm dependency. The package is ESM-only and declares `engines.node >= 20`, so it could not go through crossnote's Node 18 CJS output; nothing is imported from it at build time, and the three small interfaces crossnote calls it through are declared in the source. Its `engines` floor is also not what crossnote needs: the browser build is verified to run on Node 18 by `test/pele-vendor.test.ts`, so a pele release that stops doing so fails there instead of in a release.
74
+
75
+ To update pele:
76
+
77
+ 1. `node scripts/update-pele-bundle.mjs <new-version>` — downloads the official browser build of that version from jsDelivr into `dependencies/pele/pele.global.js`, checks that it is pele's build of that version and that it renders a diagram in the running Node (run it in the Node 18 dev shell), and prints the SHA-256 of the file.
78
+ 2. Put the printed SHA-256 into `test/pele-vendor.test.ts`.
79
+ 3. Update the `pele` version in the version list above.
80
+ 4. Update the pele version in the CDN fallback script URL in `src/markdown-engine/index.ts` (`pele@<version>/dist/pele.global.js`).
81
+ 5. Add a `CHANGELOG.md` entry.
82
+ 6. Check `test/pele-vendor.test.ts` — it fails the bump if the new bundle calls an API the oldest supported webview lacks. Unlike mermaid's, pele's bundle gets no shim: such an API has to be reported to pele or the bump held back.
83
+ 7. Look at the tests of **"the SVG it hands back, as it is"** in that file. An exported document has no sanitizer, so they draw the hostile diagrams of `test/fixtures/pele-hostile.ts` with the new bundle and fail on any element outside pele's vocabulary, event handler, link to elsewhere than the web, or style that reaches outside the diagram. A new element or attribute there is to be understood before its name is added to the test.