@rspress/plugin-preview 2.0.0-beta.4 → 2.0.0-beta.5

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/index.js +0 -14
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_solid_0a0a2645__ from "@rs
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
10
- import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__ from "@rspress/shared/node-utils";
11
10
  const staticPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(__dirname, '..', 'static');
12
11
  const demoBlockComponentPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(staticPath, 'global-components', 'DemoBlock.tsx');
13
12
  const virtualDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), 'node_modules', __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.RSPRESS_TEMP_DIR, 'virtual-demo');
@@ -316,7 +315,6 @@ const remarkCodeToDemo = function({ getRouteMeta, previewMode, defaultRenderMode
316
315
  remarkPlugin_demos[pageName] = [];
317
316
  let title = pageName;
318
317
  let index = 1;
319
- let externalDemoIndex = 0;
320
318
  function constructDemoNode(demoId, demoPath, currentNode, isMobileMode, externalDemoIndex) {
321
319
  if (isMobileMode) {
322
320
  const relativePathReg = new RegExp(/^\.\.?\/.*$/);
@@ -365,18 +363,6 @@ const remarkCodeToDemo = function({ getRouteMeta, previewMode, defaultRenderMode
365
363
  title = firstChild && 'value' in firstChild && firstChild.value || title;
366
364
  }
367
365
  });
368
- lib_visit(tree, 'mdxJsxFlowElement', (node)=>{
369
- if ('code' === node.name) {
370
- const src = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.getNodeAttribute)(node, 'src');
371
- if ('string' != typeof src) return;
372
- const currentMode = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.getNodeAttribute)(node, 'previewMode') ?? previewMode;
373
- const isMobileAttr = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.getNodeAttribute)(node, 'isMobile');
374
- let isMobileMode = false;
375
- isMobileMode = void 0 === isMobileAttr ? 'iframe' === currentMode : null === isMobileAttr ? true : 'object' == typeof isMobileAttr ? 'false' !== isMobileAttr.value : 'false' !== isMobileAttr;
376
- const id = generateId(pageName, index++);
377
- constructDemoNode(id, src, node, isMobileMode, externalDemoIndex++);
378
- }
379
- });
380
366
  lib_visit(tree, 'code', (node)=>{
381
367
  if ('hasVisited' in node) return;
382
368
  if (node.lang && previewLanguages.includes(node.lang)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-preview",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "A plugin for rspress to preview the code block in markdown/mdx file.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "static"
24
24
  ],
25
25
  "dependencies": {
26
- "@rsbuild/core": "1.3.16",
26
+ "@rsbuild/core": "1.3.17",
27
27
  "@rsbuild/plugin-babel": "~1.0.5",
28
28
  "@rsbuild/plugin-less": "~1.2.3",
29
29
  "@rsbuild/plugin-react": "~1.3.0",
@@ -31,8 +31,8 @@
31
31
  "@rsbuild/plugin-solid": "~1.0.5",
32
32
  "lodash": "4.17.21",
33
33
  "qrcode.react": "^4.2.0",
34
- "@rspress/theme-default": "2.0.0-beta.4",
35
- "@rspress/shared": "2.0.0-beta.4"
34
+ "@rspress/shared": "2.0.0-beta.5",
35
+ "@rspress/theme-default": "2.0.0-beta.5"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@rslib/core": "0.6.8",
@@ -52,7 +52,7 @@
52
52
  "unist-util-visit": "^5.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@rspress/core": "^2.0.0-beta.4",
55
+ "@rspress/core": "^2.0.0-beta.5",
56
56
  "react": ">=18.0.0",
57
57
  "react-router-dom": "^6.8.1"
58
58
  },