@rspress/plugin-playground 1.45.3 → 1.45.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.
package/dist/cli/cjs/index.js
CHANGED
|
@@ -205,9 +205,6 @@ var __webpack_exports__ = {};
|
|
|
205
205
|
const external_rspack_plugin_virtual_module_namespaceObject = require("rspack-plugin-virtual-module");
|
|
206
206
|
const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
|
|
207
207
|
const DEFAULT_MONACO_URL = 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs';
|
|
208
|
-
function normalizeUrl(u) {
|
|
209
|
-
return u.replace(/\/\//g, '/');
|
|
210
|
-
}
|
|
211
208
|
const staticPath = external_node_path_default().join(__dirname, '../../../static');
|
|
212
209
|
var lib = __webpack_require__("../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js");
|
|
213
210
|
const napi_namespaceObject = require("@oxidation-compiler/napi");
|
|
@@ -326,9 +323,9 @@ var __webpack_exports__ = {};
|
|
|
326
323
|
const getRouteMeta = ()=>cli_routeMeta;
|
|
327
324
|
if (render && !/Playground\.(jsx?|tsx?)$/.test(render)) throw new Error('[Playground]: render should ends with Playground.(jsx?|tsx?)');
|
|
328
325
|
const preloads = [];
|
|
329
|
-
const monacoPrefix = (null == (_monacoLoader_paths = monacoLoader.paths) ? void 0 : _monacoLoader_paths.vs) || DEFAULT_MONACO_URL;
|
|
330
|
-
preloads.push(
|
|
331
|
-
preloads.push(
|
|
326
|
+
const monacoPrefix = ((null == (_monacoLoader_paths = monacoLoader.paths) ? void 0 : _monacoLoader_paths.vs) || DEFAULT_MONACO_URL).replace(/\/+$/, '');
|
|
327
|
+
preloads.push(`${monacoPrefix}/loader.js`);
|
|
328
|
+
preloads.push(`${monacoPrefix}/editor/editor.main.js`);
|
|
332
329
|
return {
|
|
333
330
|
name: '@rspress/plugin-playground',
|
|
334
331
|
config (config, { removePlugin }) {
|
package/dist/cli/esm/index.mjs
CHANGED
|
@@ -192,9 +192,6 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
192
192
|
})();
|
|
193
193
|
const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
|
|
194
194
|
const DEFAULT_MONACO_URL = 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs';
|
|
195
|
-
function normalizeUrl(u) {
|
|
196
|
-
return u.replace(/\/\//g, '/');
|
|
197
|
-
}
|
|
198
195
|
var constant_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
199
196
|
const staticPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(constant_dirname, '../../../static');
|
|
200
197
|
var lib = __webpack_require__("../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js");
|
|
@@ -313,9 +310,9 @@ function pluginPlayground(options) {
|
|
|
313
310
|
const getRouteMeta = ()=>cli_routeMeta;
|
|
314
311
|
if (render && !/Playground\.(jsx?|tsx?)$/.test(render)) throw new Error('[Playground]: render should ends with Playground.(jsx?|tsx?)');
|
|
315
312
|
const preloads = [];
|
|
316
|
-
const monacoPrefix = (null == (_monacoLoader_paths = monacoLoader.paths) ? void 0 : _monacoLoader_paths.vs) || DEFAULT_MONACO_URL;
|
|
317
|
-
preloads.push(
|
|
318
|
-
preloads.push(
|
|
313
|
+
const monacoPrefix = ((null == (_monacoLoader_paths = monacoLoader.paths) ? void 0 : _monacoLoader_paths.vs) || DEFAULT_MONACO_URL).replace(/\/+$/, '');
|
|
314
|
+
preloads.push(`${monacoPrefix}/loader.js`);
|
|
315
|
+
preloads.push(`${monacoPrefix}/editor/editor.main.js`);
|
|
319
316
|
return {
|
|
320
317
|
name: '@rspress/plugin-playground',
|
|
321
318
|
config (config, { removePlugin }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-playground",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.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": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@oxidation-compiler/napi": "^0.2.0",
|
|
35
35
|
"remark-gfm": "3.0.1",
|
|
36
36
|
"rspack-plugin-virtual-module": "0.1.13",
|
|
37
|
-
"@rspress/shared": "1.45.
|
|
37
|
+
"@rspress/shared": "1.45.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@babel/types": "^7.27.1",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"typescript": "^5.5.3",
|
|
55
55
|
"unified": "^10.1.2",
|
|
56
56
|
"unist-util-visit": "^4.1.2",
|
|
57
|
-
"@rspress/plugin-playground": "1.45.
|
|
57
|
+
"@rspress/plugin-playground": "1.45.5"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@rspress/core": "^1.45.
|
|
60
|
+
"@rspress/core": "^1.45.5",
|
|
61
61
|
"react": ">=17.0.0",
|
|
62
62
|
"react-router-dom": "^6.8.1"
|
|
63
63
|
},
|
|
@@ -82,8 +82,11 @@ export default function Playground(props: PlaygroundProps) {
|
|
|
82
82
|
'rspress-playground',
|
|
83
83
|
`rspress-playground-${direction}`,
|
|
84
84
|
`rspress-playground-reverse-${useReverseLayout ? 'y' : 'n'}`,
|
|
85
|
+
'rp-not-doc',
|
|
85
86
|
className,
|
|
86
|
-
]
|
|
87
|
+
]
|
|
88
|
+
.filter(Boolean)
|
|
89
|
+
.join(' ');
|
|
87
90
|
|
|
88
91
|
return (
|
|
89
92
|
<div className={classNames} {...rest}>
|