yuhwa 1.2.0 → 1.4.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 (57) hide show
  1. package/README.md +5 -3
  2. package/dist/astro.d.ts +1 -1
  3. package/dist/astro.js +4 -3
  4. package/dist/browser.d.ts +10 -3
  5. package/dist/browser.js +85 -21
  6. package/dist/canvas.d.ts +2 -0
  7. package/dist/canvas.js +40 -0
  8. package/dist/cli.js +485 -236
  9. package/dist/editor/assets/index-DWm3xV_v.js +689 -0
  10. package/dist/editor/assets/{lsp.worker-sZtzIA6-.js → lsp.worker-N6A9m364.js} +23 -17
  11. package/dist/editor/index.html +4 -1
  12. package/dist/{figure-CA2hy0xh.d.ts → figure-BLHfxz_e.d.ts} +28 -5
  13. package/dist/index-xVW43gqW.d.ts +261 -0
  14. package/dist/index.d.ts +3 -2
  15. package/dist/index.js +5 -1
  16. package/dist/ironmark.d.ts +1 -1
  17. package/dist/ironmark.js +1 -1
  18. package/dist/lsp-browser.d.ts +2 -2
  19. package/dist/lsp-browser.js +2 -1
  20. package/dist/lsp-node.js +47 -27
  21. package/dist/lsp-server.d.ts +5 -1
  22. package/dist/lsp-server.js +1 -1
  23. package/dist/lsp.d.ts +1 -1
  24. package/dist/lsp.js +1 -1
  25. package/dist/markdown-it.d.ts +1 -1
  26. package/dist/markdown-it.js +5 -3
  27. package/dist/{node-Bzn2uKXZ.js → node-CkrQnPFb.js} +90 -12
  28. package/dist/parse--ljBMU60.js +3884 -0
  29. package/dist/plugin-CitzbblK.js +301 -0
  30. package/dist/{index-CnnoZYl0.d.ts → plugin-NMP_uf1a.d.ts} +93 -208
  31. package/dist/plugin.d.ts +12 -0
  32. package/dist/plugin.js +3 -0
  33. package/dist/raster-iqi6XRPU.js +299 -0
  34. package/dist/remark.d.ts +1 -1
  35. package/dist/remark.js +1 -1
  36. package/dist/rolldown-runtime-CEjnN5Q1.js +37 -0
  37. package/dist/{server-Dxo7OG8K.js → server-BTYtmr6B.js} +41 -63
  38. package/dist/{server--jHjJjOS.d.ts → server-DMAOtqqK.d.ts} +1 -1
  39. package/dist/{service-B1fpOg_L.js → service-C60VdeKS.js} +35 -3
  40. package/dist/{service-Brvpt7Do.d.ts → service-DimTFsE3.d.ts} +2 -0
  41. package/dist/{shared-Ddw88O9D.js → shared-h8tkFLY4.js} +719 -421
  42. package/dist/{src-DkQj7aIV.js → src-NCXCTK_4.js} +512 -4548
  43. package/dist/svg-uri-Dx8SGV-n.js +7 -0
  44. package/dist/vite.d.ts +1 -1
  45. package/dist/vite.js +3 -2
  46. package/dist/vuepress.d.ts +3 -2
  47. package/dist/vuepress.js +4 -2
  48. package/dist/watch-2VeW5DUN.js +35 -0
  49. package/dist/yuhwa.iife.js +55 -54
  50. package/dist/zoom-script-CaJ5MNUw.js +29 -0
  51. package/dist/{zoom-QeqB6QlH.js → zoom-yxhxX16c.js} +1 -1
  52. package/dist/zoom.d.ts +16 -7
  53. package/dist/zoom.js +2 -2
  54. package/package.json +24 -2
  55. package/skills/yuhwa/SKILL.md +12 -0
  56. package/dist/editor/assets/index-BphHLTvA.js +0 -689
  57. package/dist/zoom-script-CVdAzMhX.js +0 -51
@@ -1,51 +0,0 @@
1
- import { n as zoomable } from "./zoom-QeqB6QlH.js";
2
- // src/integrations/zoom-script.ts
3
- /**
4
- * Pan and zoom for figures rendered with `zoom`: every
5
- * `[data-zoom] > .yuhwa-view` becomes a viewer (drag, Ctrl/⌘ + wheel, pinch,
6
- * double-click, `+` `-` `0`, buttons and full screen). The figure's
7
- * `data-zoom` value, when set, is the viewer's height. A MutationObserver
8
- * picks up figures added later by client-side navigation, and figures whose
9
- * viewer a framework threw away on hydration. It watches `document`, not
10
- * `<html>`, because hydration can replace the `<html>` element.
11
- *
12
- * `make` is the viewer itself; `zoomScript` passes it in as an argument, so
13
- * the string needs no imports.
14
- */
15
- function installZoom(make = zoomable) {
16
- const w = window;
17
- if (w.__yuhwaZoom) return;
18
- w.__yuhwaZoom = true;
19
- const attach = () => {
20
- document.querySelectorAll("[data-zoom] > .yuhwa-view").forEach((view) => {
21
- if (view.yuhwaZoom && view.querySelector(":scope > .yuhwa-zoom-stage")) return;
22
- make(view, { height: view.parentElement?.getAttribute("data-zoom") || void 0 });
23
- });
24
- };
25
- let queued = false;
26
- const later = () => {
27
- if (queued) return;
28
- queued = true;
29
- requestAnimationFrame(() => {
30
- queued = false;
31
- attach();
32
- });
33
- };
34
- if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", attach, { once: true });
35
- else attach();
36
- addEventListener("load", later);
37
- addEventListener("pageshow", later);
38
- new MutationObserver((records) => {
39
- if (records.some((r) => [...r.addedNodes].some((n) => n.nodeType === 1))) later();
40
- }).observe(document, {
41
- childList: true,
42
- subtree: true
43
- });
44
- }
45
- /**
46
- * The same code as a string, for an inline `<script>` or a site's `head`.
47
- * Squeezed: no blank lines (they would end a Markdown HTML block), and none of
48
- * the code's strings hold two spaces in a row.
49
- */
50
- const zoomScript = `(${installZoom})(${zoomable});`.replace(/\s*\n\s*/g, "\n").replace(/[ \t]{2,}/g, " ");
51
- export { zoomScript as n, installZoom as t };