@rspress-theme-anatole/theme-default 0.6.1-alpha → 0.6.1-alpha.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.
Files changed (2) hide show
  1. package/dist/bundle.js +3 -5
  2. package/package.json +3 -3
package/dist/bundle.js CHANGED
@@ -41,7 +41,6 @@ import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_jump_20d3ca88__ from "@theme
41
41
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_title_56a7311e__ from "@theme-assets/title";
42
42
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_github_cac38251__ from "@theme-assets/github";
43
43
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_gitlab_a0e4f082__ from "@theme-assets/gitlab";
44
- import * as __WEBPACK_EXTERNAL_MODULE_html2pdf_js_65368f2c__ from "html2pdf.js";
45
44
 
46
45
  function isMobileDevice() {
47
46
  return window.innerWidth < 1280;
@@ -5518,11 +5517,10 @@ async function exportContentToPDF() {
5518
5517
  });
5519
5518
  document.body.appendChild(tip);
5520
5519
 
5520
+ const html2pdf = (await import('html2pdf.js')).default;
5521
+
5521
5522
  fixMermaidSVGs();
5522
5523
 
5523
- // if (!window.html2pdf) {
5524
- // await loadScript('https://cdn.jsdelivr.net/npm/html2pdf.js@0.10.1/dist/html2pdf.bundle.min.js');
5525
- // }
5526
5524
  const element = document.querySelector('.rspress-doc');
5527
5525
  if (!element) {
5528
5526
  alert('No content to export.');
@@ -5544,7 +5542,7 @@ async function exportContentToPDF() {
5544
5542
  };
5545
5543
 
5546
5544
  // 生成 PDF 并在完成后移除提示
5547
- __WEBPACK_EXTERNAL_MODULE_html2pdf_js_65368f2c__.html2pdf().set(opt).from(element).save().then(() => {
5545
+ html2pdf().set(opt).from(element).save().then(() => {
5548
5546
  document.body.removeChild(tip);
5549
5547
  }).catch(() => {
5550
5548
  document.body.removeChild(tip);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rspress-theme-anatole/theme-default",
3
3
  "author": "Anatole Tong",
4
- "version": "0.6.1-alpha",
4
+ "version": "0.6.1-alpha.1",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
7
7
  "*.css",
@@ -21,8 +21,8 @@
21
21
  "types": "./dist/bundle.d.ts",
22
22
  "dependencies": {
23
23
  "@mdx-js/react": "2.3.0",
24
- "@rspress-theme-anatole/rspress-plugin-mermaid": "0.6.1-alpha",
25
- "@rspress-theme-anatole/shared": "0.6.1-alpha",
24
+ "@rspress-theme-anatole/rspress-plugin-mermaid": "0.6.1-alpha.1",
25
+ "@rspress-theme-anatole/shared": "0.6.1-alpha.1",
26
26
  "@rspress/runtime": "1.43.8",
27
27
  "body-scroll-lock": "4.0.0-beta.0",
28
28
  "copy-to-clipboard": "^3.3.3",