@rspress/plugin-playground 2.0.0-beta.21 → 2.0.0-beta.23
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.
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorProps } from '@monaco-editor/react';
|
|
2
2
|
import type { loader } from '@monaco-editor/react';
|
|
3
|
-
import type { RouteMeta } from 'rspress/core';
|
|
4
|
-
import type { RspressPlugin } from 'rspress/core';
|
|
3
|
+
import type { RouteMeta } from '@rspress/core';
|
|
4
|
+
import type { RspressPlugin } from '@rspress/core';
|
|
5
5
|
|
|
6
6
|
declare interface PlaygroundOptions {
|
|
7
7
|
render: string;
|
package/dist/cli/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
|
2
2
|
import { dirname as __webpack_dirname__ } from "node:path";
|
|
3
3
|
import node_fs from "node:fs";
|
|
4
4
|
import node_path, { join, resolve } from "node:path";
|
|
5
|
+
import { getNodeAttribute } from "@rspress/core";
|
|
5
6
|
import { RspackVirtualModulePlugin } from "rspack-plugin-virtual-module";
|
|
6
|
-
import { getNodeAttribute } from "rspress/core";
|
|
7
7
|
import { visit as external_unist_util_visit_visit } from "unist-util-visit";
|
|
8
8
|
import napi from "@oxidation-compiler/napi";
|
|
9
9
|
const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
|
package/dist/web/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import react, { loader } from "@monaco-editor/react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDark } from "@rspress/core/runtime";
|
|
3
4
|
import react_0, { Component, useMemo } from "react";
|
|
4
|
-
import { useDark } from "rspress/runtime";
|
|
5
5
|
const DEFAULT_MONACO_URL = 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs';
|
|
6
6
|
function initLoader() {
|
|
7
7
|
let loaderConfig = {
|
|
@@ -252,7 +252,7 @@ class Runner extends Component {
|
|
|
252
252
|
if (prevProps.code !== this.props.code) this.waitCompile(this.props.code);
|
|
253
253
|
}
|
|
254
254
|
render() {
|
|
255
|
-
const { className = '', code, language, getImport, ...rest } = this.props;
|
|
255
|
+
const { className = '', code: _code, language: _language, getImport: _getImport, ...rest } = this.props;
|
|
256
256
|
const { error, comp } = this.state;
|
|
257
257
|
return /*#__PURE__*/ jsxs("div", {
|
|
258
258
|
className: `rspress-playground-runner ${className}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-playground",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.23",
|
|
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": {
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"unist-util-visit": "^5.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@babel/types": "^7.28.
|
|
38
|
+
"@babel/types": "^7.28.2",
|
|
39
39
|
"@rsbuild/plugin-react": "~1.3.4",
|
|
40
|
-
"@rslib/core": "0.
|
|
40
|
+
"@rslib/core": "0.11.0",
|
|
41
41
|
"@types/babel__core": "^7.20.5",
|
|
42
42
|
"@types/babel__standalone": "^7.1.9",
|
|
43
43
|
"@types/babel__traverse": "^7.20.7",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"rsbuild-plugin-publint": "^0.3.2",
|
|
53
53
|
"typescript": "^5.8.2",
|
|
54
54
|
"unified": "^11.0.5",
|
|
55
|
-
"@rspress/plugin-playground": "2.0.0-beta.
|
|
55
|
+
"@rspress/plugin-playground": "2.0.0-beta.23"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
+
"@rspress/core": "^2.0.0-beta.23",
|
|
58
59
|
"react": ">=18.0.0",
|
|
59
|
-
"react-router-dom": "^6.8.1"
|
|
60
|
-
"rspress": "^2.0.0-beta.21"
|
|
60
|
+
"react-router-dom": "^6.8.1"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=18.0.0"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { usePageData } from '@rspress/core/runtime';
|
|
1
2
|
import { Editor, Runner } from '@rspress/plugin-playground/web';
|
|
2
3
|
// @ts-ignore Cannot find module _rspress_playground_imports
|
|
3
4
|
import getImport from '_rspress_playground_imports';
|
|
4
|
-
import
|
|
5
|
+
import {
|
|
5
6
|
type HTMLAttributes,
|
|
6
7
|
type ReactNode,
|
|
7
8
|
useCallback,
|
|
8
9
|
useState,
|
|
9
10
|
} from 'react';
|
|
10
|
-
import { usePageData } from 'rspress/runtime';
|
|
11
11
|
|
|
12
12
|
// inject by builder in cli/index.ts
|
|
13
13
|
declare global {
|
|
@@ -58,7 +58,7 @@ export default function Playground(props: PlaygroundProps) {
|
|
|
58
58
|
code: codeProp,
|
|
59
59
|
language,
|
|
60
60
|
className = '',
|
|
61
|
-
direction:
|
|
61
|
+
direction: _directionProp,
|
|
62
62
|
editorPosition,
|
|
63
63
|
renderChildren,
|
|
64
64
|
...rest
|