@rspress/plugin-preview 2.0.0-beta.0 → 2.0.0-beta.10

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/index.js CHANGED
@@ -1,128 +1,66 @@
1
- "use strict";
2
- var __webpack_modules__ = {
3
- "@rsbuild/plugin-less": function(module) {
4
- module.exports = import("@rsbuild/plugin-less").then(function(module) {
5
- return module;
6
- });
7
- },
8
- "@rsbuild/plugin-sass": function(module) {
9
- module.exports = import("@rsbuild/plugin-sass").then(function(module) {
10
- return module;
11
- });
12
- }
1
+ import * as __WEBPACK_EXTERNAL_MODULE_node_net_0373943e__ from "node:net";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel_2a5a8b08__ from "@rsbuild/plugin-babel";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_react_7b149ee4__ from "@rsbuild/plugin-react";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_solid_0a0a2645__ from "@rsbuild/plugin-solid";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
10
+ const staticPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(__dirname, '..', 'static');
11
+ const demoBlockComponentPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(staticPath, 'global-components', 'DemoBlock.tsx');
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');
13
+ const toValidVarName = (str)=>{
14
+ if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(str)) return str;
15
+ return str.replace(/[^0-9a-zA-Z_$]/g, '_').replace(/^([0-9])/, '_$1');
13
16
  };
14
- var __webpack_module_cache__ = {};
15
- function __webpack_require__(moduleId) {
16
- var cachedModule = __webpack_module_cache__[moduleId];
17
- if (void 0 !== cachedModule) return cachedModule.exports;
18
- var module = __webpack_module_cache__[moduleId] = {
19
- exports: {}
20
- };
21
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
22
- return module.exports;
23
- }
24
- (()=>{
25
- __webpack_require__.n = (module)=>{
26
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
27
- __webpack_require__.d(getter, {
28
- a: getter
29
- });
30
- return getter;
31
- };
32
- })();
33
- (()=>{
34
- __webpack_require__.d = (exports1, definition)=>{
35
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
36
- enumerable: true,
37
- get: definition[key]
38
- });
39
- };
40
- })();
41
- (()=>{
42
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
43
- })();
44
- (()=>{
45
- __webpack_require__.r = (exports1)=>{
46
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
47
- value: 'Module'
48
- });
49
- Object.defineProperty(exports1, '__esModule', {
50
- value: true
51
- });
52
- };
53
- })();
54
- var __webpack_exports__ = {};
55
- (()=>{
56
- __webpack_require__.r(__webpack_exports__);
57
- __webpack_require__.d(__webpack_exports__, {
58
- pluginPreview: ()=>pluginPreview
59
- });
60
- const external_node_net_namespaceObject = require("node:net");
61
- var external_node_net_default = /*#__PURE__*/ __webpack_require__.n(external_node_net_namespaceObject);
62
- const external_node_path_namespaceObject = require("node:path");
63
- var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
64
- const core_namespaceObject = require("@rsbuild/core");
65
- const plugin_babel_namespaceObject = require("@rsbuild/plugin-babel");
66
- const plugin_react_namespaceObject = require("@rsbuild/plugin-react");
67
- const plugin_solid_namespaceObject = require("@rsbuild/plugin-solid");
68
- const shared_namespaceObject = require("@rspress/shared");
69
- const external_lodash_namespaceObject = require("lodash");
70
- const staticPath = external_node_path_default().join(__dirname, '..', 'static');
71
- const demoBlockComponentPath = external_node_path_default().join(staticPath, 'global-components', 'DemoBlock.tsx');
72
- const virtualDir = external_node_path_default().join(process.cwd(), 'node_modules', shared_namespaceObject.RSPRESS_TEMP_DIR, 'virtual-demo');
73
- const external_node_fs_namespaceObject = require("node:fs");
74
- var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
75
- const toValidVarName = (str)=>{
76
- if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(str)) return str;
77
- return str.replace(/[^0-9a-zA-Z_$]/g, '_').replace(/^([0-9])/, '_$1');
78
- };
79
- const generateId = (pageName, index)=>`_${toValidVarName(pageName)}_${index}`;
80
- const injectDemoBlockImport = (str, path)=>`
17
+ const generateId = (pageName, index)=>`_${toValidVarName(pageName)}_${index}`;
18
+ const injectDemoBlockImport = (str, path)=>`
81
19
  import DemoBlock from ${JSON.stringify(path)};
82
20
  ${str}
83
21
  `;
84
- const getLangFileExt = (lang)=>{
85
- switch(lang){
86
- case 'jsx':
87
- case 'tsx':
88
- return 'tsx';
89
- case 'json':
90
- return 'tsx';
91
- default:
92
- return lang;
93
- }
94
- };
95
- function generateEntry(demos, framework, position, customEntry) {
96
- const sourceEntry = {};
97
- const entryCssPath = (0, external_node_path_namespaceObject.join)(staticPath, 'global-styles', 'entry.css');
98
- if ('follow' === position) Object.values(demos).forEach((routes)=>{
99
- routes.forEach((route)=>{
100
- const { id, path: demoPath } = route;
101
- const entry = (0, external_node_path_namespaceObject.join)(virtualDir, `${id}.entry.tsx`);
102
- const solidEntry = `
22
+ const getLangFileExt = (lang)=>{
23
+ switch(lang){
24
+ case 'jsx':
25
+ case 'tsx':
26
+ return 'tsx';
27
+ case 'json':
28
+ return 'tsx';
29
+ default:
30
+ return lang;
31
+ }
32
+ };
33
+ function generateEntry(demos, framework, position, customEntry) {
34
+ const sourceEntry = {};
35
+ const entryCssPath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(staticPath, 'global-styles', 'entry.css');
36
+ if ('follow' === position) Object.values(demos).forEach((routes)=>{
37
+ routes.forEach((route)=>{
38
+ const { id, path: demoPath } = route;
39
+ const entry = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(virtualDir, `${id}.entry.tsx`);
40
+ const solidEntry = `
103
41
  import { render } from 'solid-js/web';
104
42
  import ${JSON.stringify(entryCssPath)};
105
43
  import Demo from ${JSON.stringify(demoPath)};
106
44
  render(() => <Demo />, document.getElementById('root'));
107
45
  `;
108
- const reactEntry = `
46
+ const reactEntry = `
109
47
  import { createRoot } from 'react-dom/client';
110
48
  import ${JSON.stringify(entryCssPath)};
111
49
  import Demo from ${JSON.stringify(demoPath)};
112
50
  const container = document.getElementById('root');
113
51
  createRoot(container).render(<Demo />);
114
52
  `;
115
- const entryContent = customEntry ? customEntry({
116
- entryCssPath,
117
- demoPath
118
- }) : 'react' === framework ? reactEntry : solidEntry;
119
- (0, external_node_fs_namespaceObject.writeFileSync)(entry, entryContent);
120
- sourceEntry[id] = entry;
121
- });
53
+ const entryContent = customEntry ? customEntry({
54
+ entryCssPath,
55
+ demoPath
56
+ }) : 'react' === framework ? reactEntry : solidEntry;
57
+ (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.writeFileSync)(entry, entryContent);
58
+ sourceEntry[id] = entry;
122
59
  });
123
- else Object.entries(demos).forEach(([key, routes])=>{
124
- if (0 === routes.length) return;
125
- const reactContent = `
60
+ });
61
+ else Object.entries(demos).forEach(([key, routes])=>{
62
+ if (0 === routes.length) return;
63
+ const reactContent = `
126
64
  import { createRoot } from 'react-dom/client';
127
65
  import ${JSON.stringify(entryCssPath)};
128
66
  ${routes.map((demo, index)=>`import Demo_${index} from ${JSON.stringify(demo.path)}`).join('\n')}
@@ -137,7 +75,7 @@ var __webpack_exports__ = {};
137
75
  const container = document.getElementById('root');
138
76
  createRoot(container).render(<App />);
139
77
  `;
140
- const solidContent = `
78
+ const solidContent = `
141
79
  import { render } from 'solid-js/web';
142
80
  import ${JSON.stringify(entryCssPath)};
143
81
  ${routes.map((demo, index)=>`import Demo_${index} from ${JSON.stringify(demo.path)}`).join('\n')}
@@ -151,491 +89,466 @@ var __webpack_exports__ = {};
151
89
  }
152
90
  render(() => <App /> , document.getElementById('root'));
153
91
  `;
154
- const renderContent = 'solid' === framework ? solidContent : reactContent;
155
- const id = `_${toValidVarName(key)}`;
156
- const entry = (0, external_node_path_namespaceObject.join)(virtualDir, `${id}.entry.tsx`);
157
- (0, external_node_fs_namespaceObject.writeFileSync)(entry, renderContent);
158
- sourceEntry[id] = entry;
159
- });
160
- return sourceEntry;
161
- }
162
- const node_utils_namespaceObject = require("@rspress/shared/node-utils");
163
- const convert = function(test) {
164
- if (null == test) return ok;
165
- if ('function' == typeof test) return castFactory(test);
166
- if ('object' == typeof test) return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
167
- if ('string' == typeof test) return typeFactory(test);
168
- throw new Error('Expected function, string, or object as test');
169
- };
170
- function anyFactory(tests) {
171
- const checks = [];
92
+ const renderContent = 'solid' === framework ? solidContent : reactContent;
93
+ const id = `_${toValidVarName(key)}`;
94
+ const entry = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(virtualDir, `${id}.entry.tsx`);
95
+ (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.writeFileSync)(entry, renderContent);
96
+ sourceEntry[id] = entry;
97
+ });
98
+ return sourceEntry;
99
+ }
100
+ const convert = function(test) {
101
+ if (null == test) return ok;
102
+ if ('function' == typeof test) return castFactory(test);
103
+ if ('object' == typeof test) return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
104
+ if ('string' == typeof test) return typeFactory(test);
105
+ throw new Error('Expected function, string, or object as test');
106
+ };
107
+ function anyFactory(tests) {
108
+ const checks = [];
109
+ let index = -1;
110
+ while(++index < tests.length)checks[index] = convert(tests[index]);
111
+ return castFactory(any);
112
+ function any(...parameters) {
172
113
  let index = -1;
173
- while(++index < tests.length)checks[index] = convert(tests[index]);
174
- return castFactory(any);
175
- function any(...parameters) {
176
- let index = -1;
177
- while(++index < checks.length)if (checks[index].apply(this, parameters)) return true;
178
- return false;
179
- }
180
- }
181
- function propsFactory(check) {
182
- const checkAsRecord = check;
183
- return castFactory(all);
184
- function all(node) {
185
- const nodeAsRecord = node;
186
- let key;
187
- for(key in check)if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
188
- return true;
189
- }
190
- }
191
- function typeFactory(check) {
192
- return castFactory(type);
193
- function type(node) {
194
- return node && node.type === check;
195
- }
196
- }
197
- function castFactory(testFunction) {
198
- return check;
199
- function check(value, index, parent) {
200
- return Boolean(looksLikeANode(value) && testFunction.call(this, value, 'number' == typeof index ? index : void 0, parent || void 0));
201
- }
114
+ while(++index < checks.length)if (checks[index].apply(this, parameters)) return true;
115
+ return false;
202
116
  }
203
- function ok() {
117
+ }
118
+ function propsFactory(check) {
119
+ const checkAsRecord = check;
120
+ return castFactory(all);
121
+ function all(node) {
122
+ const nodeAsRecord = node;
123
+ let key;
124
+ for(key in check)if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
204
125
  return true;
205
126
  }
206
- function looksLikeANode(value) {
207
- return null !== value && 'object' == typeof value && 'type' in value;
127
+ }
128
+ function typeFactory(check) {
129
+ return castFactory(type);
130
+ function type(node) {
131
+ return node && node.type === check;
208
132
  }
209
- function color(d) {
210
- return '\u001B[33m' + d + '\u001B[39m';
133
+ }
134
+ function castFactory(testFunction) {
135
+ return check;
136
+ function check(value, index, parent) {
137
+ return Boolean(looksLikeANode(value) && testFunction.call(this, value, 'number' == typeof index ? index : void 0, parent || void 0));
211
138
  }
212
- const empty = [];
213
- const CONTINUE = true;
214
- const EXIT = false;
215
- const SKIP = 'skip';
216
- function visitParents(tree, test, visitor, reverse) {
217
- let check;
218
- if ('function' == typeof test && 'function' != typeof visitor) {
219
- reverse = visitor;
220
- visitor = test;
221
- } else check = test;
222
- const is = convert(check);
223
- const step = reverse ? -1 : 1;
224
- factory(tree, void 0, [])();
225
- function factory(node, index, parents) {
226
- const value = node && 'object' == typeof node ? node : {};
227
- if ('string' == typeof value.type) {
228
- const name = 'string' == typeof value.tagName ? value.tagName : 'string' == typeof value.name ? value.name : void 0;
229
- Object.defineProperty(visit, 'name', {
230
- value: 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'
231
- });
139
+ }
140
+ function ok() {
141
+ return true;
142
+ }
143
+ function looksLikeANode(value) {
144
+ return null !== value && 'object' == typeof value && 'type' in value;
145
+ }
146
+ function color(d) {
147
+ return '\u001B[33m' + d + '\u001B[39m';
148
+ }
149
+ const empty = [];
150
+ const CONTINUE = true;
151
+ const EXIT = false;
152
+ const SKIP = 'skip';
153
+ function visitParents(tree, test, visitor, reverse) {
154
+ let check;
155
+ if ('function' == typeof test && 'function' != typeof visitor) {
156
+ reverse = visitor;
157
+ visitor = test;
158
+ } else check = test;
159
+ const is = convert(check);
160
+ const step = reverse ? -1 : 1;
161
+ factory(tree, void 0, [])();
162
+ function factory(node, index, parents) {
163
+ const value = node && 'object' == typeof node ? node : {};
164
+ if ('string' == typeof value.type) {
165
+ const name = 'string' == typeof value.tagName ? value.tagName : 'string' == typeof value.name ? value.name : void 0;
166
+ Object.defineProperty(visit, 'name', {
167
+ value: 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'
168
+ });
169
+ }
170
+ return visit;
171
+ function visit() {
172
+ let result = empty;
173
+ let subresult;
174
+ let offset;
175
+ let grandparents;
176
+ if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
177
+ result = toResult(visitor(node, parents));
178
+ if (result[0] === EXIT) return result;
232
179
  }
233
- return visit;
234
- function visit() {
235
- let result = empty;
236
- let subresult;
237
- let offset;
238
- let grandparents;
239
- if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
240
- result = toResult(visitor(node, parents));
241
- if (result[0] === EXIT) return result;
242
- }
243
- if ('children' in node && node.children) {
244
- const nodeAsParent = node;
245
- if (nodeAsParent.children && result[0] !== SKIP) {
246
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
247
- grandparents = parents.concat(nodeAsParent);
248
- while(offset > -1 && offset < nodeAsParent.children.length){
249
- const child = nodeAsParent.children[offset];
250
- subresult = factory(child, offset, grandparents)();
251
- if (subresult[0] === EXIT) return subresult;
252
- offset = 'number' == typeof subresult[1] ? subresult[1] : offset + step;
253
- }
180
+ if ('children' in node && node.children) {
181
+ const nodeAsParent = node;
182
+ if (nodeAsParent.children && result[0] !== SKIP) {
183
+ offset = (reverse ? nodeAsParent.children.length : -1) + step;
184
+ grandparents = parents.concat(nodeAsParent);
185
+ while(offset > -1 && offset < nodeAsParent.children.length){
186
+ const child = nodeAsParent.children[offset];
187
+ subresult = factory(child, offset, grandparents)();
188
+ if (subresult[0] === EXIT) return subresult;
189
+ offset = 'number' == typeof subresult[1] ? subresult[1] : offset + step;
254
190
  }
255
191
  }
256
- return result;
257
192
  }
193
+ return result;
258
194
  }
259
195
  }
260
- function toResult(value) {
261
- if (Array.isArray(value)) return value;
262
- if ('number' == typeof value) return [
263
- CONTINUE,
264
- value
265
- ];
266
- return null == value ? empty : [
267
- value
268
- ];
196
+ }
197
+ function toResult(value) {
198
+ if (Array.isArray(value)) return value;
199
+ if ('number' == typeof value) return [
200
+ CONTINUE,
201
+ value
202
+ ];
203
+ return null == value ? empty : [
204
+ value
205
+ ];
206
+ }
207
+ function lib_visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
208
+ let reverse;
209
+ let test;
210
+ let visitor;
211
+ if ('function' == typeof testOrVisitor && 'function' != typeof visitorOrReverse) {
212
+ test = void 0;
213
+ visitor = testOrVisitor;
214
+ reverse = visitorOrReverse;
215
+ } else {
216
+ test = testOrVisitor;
217
+ visitor = visitorOrReverse;
218
+ reverse = maybeReverse;
269
219
  }
270
- function lib_visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
271
- let reverse;
272
- let test;
273
- let visitor;
274
- if ('function' == typeof testOrVisitor && 'function' != typeof visitorOrReverse) {
275
- test = void 0;
276
- visitor = testOrVisitor;
277
- reverse = visitorOrReverse;
278
- } else {
279
- test = testOrVisitor;
280
- visitor = visitorOrReverse;
281
- reverse = maybeReverse;
282
- }
283
- visitParents(tree, test, overload, reverse);
284
- function overload(node, parents) {
285
- const parent = parents[parents.length - 1];
286
- const index = parent ? parent.children.indexOf(node) : void 0;
287
- return visitor(node, index, parent);
288
- }
220
+ visitParents(tree, test, overload, reverse);
221
+ function overload(node, parents) {
222
+ const parent = parents[parents.length - 1];
223
+ const index = parent ? parent.children.indexOf(node) : void 0;
224
+ return visitor(node, index, parent);
289
225
  }
290
- const getASTNodeImport = (name, from)=>({
291
- type: 'mdxjsEsm',
292
- value: `import ${name} from ${JSON.stringify(from)}`,
293
- data: {
294
- estree: {
295
- type: 'Program',
296
- sourceType: 'module',
297
- body: [
298
- {
299
- type: 'ImportDeclaration',
300
- specifiers: [
301
- {
302
- type: 'ImportDefaultSpecifier',
303
- local: {
304
- type: 'Identifier',
305
- name
306
- }
226
+ }
227
+ const getASTNodeImport = (name, from)=>({
228
+ type: 'mdxjsEsm',
229
+ value: `import ${name} from ${JSON.stringify(from)}`,
230
+ data: {
231
+ estree: {
232
+ type: 'Program',
233
+ sourceType: 'module',
234
+ body: [
235
+ {
236
+ type: 'ImportDeclaration',
237
+ specifiers: [
238
+ {
239
+ type: 'ImportDefaultSpecifier',
240
+ local: {
241
+ type: 'Identifier',
242
+ name
307
243
  }
308
- ],
309
- source: {
310
- type: 'Literal',
311
- value: from,
312
- raw: `${JSON.stringify(from)}`
313
244
  }
245
+ ],
246
+ source: {
247
+ type: 'Literal',
248
+ value: from,
249
+ raw: `${JSON.stringify(from)}`
314
250
  }
315
- ]
316
- }
251
+ }
252
+ ]
317
253
  }
318
- });
319
- const getExternalDemoContent = (tempVar)=>({
320
- type: 'mdxJsxFlowElement',
321
- name: '',
322
- attributes: [],
323
- children: [
324
- {
325
- type: 'mdxJsxFlowElement',
326
- name: 'pre',
327
- attributes: [],
328
- children: [
329
- {
330
- type: 'mdxJsxFlowElement',
331
- name: 'code',
332
- attributes: [
333
- {
334
- type: 'mdxJsxAttribute',
335
- name: 'className',
336
- value: 'language-tsx'
337
- },
338
- {
339
- type: 'mdxJsxAttribute',
340
- name: 'children',
341
- value: {
342
- type: 'mdxJsxExpressionAttribute',
343
- value: tempVar,
344
- data: {
345
- estree: {
346
- type: 'Program',
347
- body: [
348
- {
349
- type: 'ExpressionStatement',
350
- expression: {
351
- type: 'Identifier',
352
- name: tempVar
353
- }
254
+ }
255
+ });
256
+ const getExternalDemoContent = (tempVar)=>({
257
+ type: 'mdxJsxFlowElement',
258
+ name: '',
259
+ attributes: [],
260
+ children: [
261
+ {
262
+ type: 'mdxJsxFlowElement',
263
+ name: 'pre',
264
+ attributes: [],
265
+ children: [
266
+ {
267
+ type: 'mdxJsxFlowElement',
268
+ name: 'code',
269
+ attributes: [
270
+ {
271
+ type: 'mdxJsxAttribute',
272
+ name: 'className',
273
+ value: 'language-tsx'
274
+ },
275
+ {
276
+ type: 'mdxJsxAttribute',
277
+ name: 'children',
278
+ value: {
279
+ type: 'mdxJsxExpressionAttribute',
280
+ value: tempVar,
281
+ data: {
282
+ estree: {
283
+ type: 'Program',
284
+ body: [
285
+ {
286
+ type: 'ExpressionStatement',
287
+ expression: {
288
+ type: 'Identifier',
289
+ name: tempVar
354
290
  }
355
- ]
356
- }
291
+ }
292
+ ]
357
293
  }
358
294
  }
359
295
  }
360
- ]
361
- }
362
- ]
363
- }
364
- ]
365
- });
366
- const remarkPlugin_demos = {};
367
- const remarkCodeToDemo = function({ getRouteMeta, previewMode, defaultRenderMode, position, previewLanguages, previewCodeTransform }) {
368
- const routeMeta = getRouteMeta();
369
- external_node_fs_default().mkdirSync(virtualDir, {
370
- recursive: true
371
- });
372
- const data = this.data();
373
- return (tree, vfile)=>{
374
- const demoMdx = [];
375
- const route = routeMeta.find((meta)=>(0, shared_namespaceObject.normalizePosixPath)(meta.absolutePath) === (0, shared_namespaceObject.normalizePosixPath)(vfile.path || vfile.history[0]));
376
- if (!route) return;
377
- const { pageName } = route;
378
- remarkPlugin_demos[pageName] = [];
379
- let title = pageName;
380
- let index = 1;
381
- let externalDemoIndex = 0;
382
- function constructDemoNode(demoId, demoPath, currentNode, isMobileMode, externalDemoIndex) {
383
- if (isMobileMode) {
384
- const relativePathReg = new RegExp(/^\.\.?\/.*$/);
385
- remarkPlugin_demos[pageName].push({
386
- title,
387
- id: demoId,
388
- path: relativePathReg.test(demoPath) ? (0, external_node_path_namespaceObject.resolve)(vfile.dirname || (0, external_node_path_namespaceObject.dirname)(vfile.path), demoPath) : demoPath
389
- });
390
- } else demoMdx.push(getASTNodeImport(`Demo${demoId}`, demoPath));
391
- const tempVar = `externalDemoContent${externalDemoIndex}`;
392
- if (void 0 !== externalDemoIndex) demoMdx.push(getASTNodeImport(tempVar, `!!${demoPath}?raw`));
393
- if (isMobileMode && 'fixed' === position) void 0 !== externalDemoIndex && Object.assign(currentNode, getExternalDemoContent(tempVar));
394
- else Object.assign(currentNode, {
395
- type: 'mdxJsxFlowElement',
396
- name: 'Container',
397
- attributes: [
398
- {
399
- type: 'mdxJsxAttribute',
400
- name: 'isMobile',
401
- value: isMobileMode
402
- },
403
- {
404
- type: 'mdxJsxAttribute',
405
- name: 'demoId',
406
- value: demoId
407
- }
408
- ],
409
- children: [
410
- void 0 === externalDemoIndex ? {
411
- ...currentNode,
412
- hasVisited: true
413
- } : getExternalDemoContent(tempVar),
414
- isMobileMode ? {
415
- type: 'mdxJsxFlowElement',
416
- name: null
417
- } : {
418
- type: 'mdxJsxFlowElement',
419
- name: `Demo${demoId}`
420
- }
421
- ]
422
- });
296
+ }
297
+ ]
298
+ }
299
+ ]
423
300
  }
424
- lib_visit(tree, 'heading', (node)=>{
425
- if (1 === node.depth) {
426
- const firstChild = node.children[0];
427
- title = firstChild && 'value' in firstChild && firstChild.value || title;
428
- }
429
- });
430
- lib_visit(tree, 'mdxJsxFlowElement', (node)=>{
431
- if ('code' === node.name) {
432
- const src = (0, node_utils_namespaceObject.getNodeAttribute)(node, 'src');
433
- if ('string' != typeof src) return;
434
- const currentMode = (0, node_utils_namespaceObject.getNodeAttribute)(node, 'previewMode') ?? previewMode;
435
- const isMobileAttr = (0, node_utils_namespaceObject.getNodeAttribute)(node, 'isMobile');
436
- let isMobileMode = false;
437
- isMobileMode = void 0 === isMobileAttr ? 'iframe' === currentMode : null === isMobileAttr ? true : 'object' == typeof isMobileAttr ? 'false' !== isMobileAttr.value : 'false' !== isMobileAttr;
438
- const id = generateId(pageName, index++);
439
- constructDemoNode(id, src, node, isMobileMode, externalDemoIndex++);
440
- }
441
- });
442
- lib_visit(tree, 'code', (node)=>{
443
- if ('hasVisited' in node) return;
444
- if (node.lang && previewLanguages.includes(node.lang)) {
445
- var _node_meta, _node_meta1, _node_meta2, _node_meta3, _node_meta4, _node_meta5;
446
- if ((null == (_node_meta = node.meta) ? void 0 : _node_meta.includes('pure')) || !(null == (_node_meta1 = node.meta) ? void 0 : _node_meta1.includes('preview')) && 'pure' === defaultRenderMode) return;
447
- const isJsx = 'jsx' === node.lang || 'tsx' === node.lang;
448
- const value = isJsx ? injectDemoBlockImport(previewCodeTransform({
449
- language: node.lang,
450
- code: node.value
451
- }), demoBlockComponentPath) : previewCodeTransform({
452
- language: node.lang,
453
- code: node.value
454
- });
455
- const isMobileMode = (null == (_node_meta2 = node.meta) ? void 0 : _node_meta2.includes('mobile')) || (null == (_node_meta3 = node.meta) ? void 0 : _node_meta3.includes('iframe')) || !(null == (_node_meta4 = node.meta) ? void 0 : _node_meta4.includes('web')) && !(null == (_node_meta5 = node.meta) ? void 0 : _node_meta5.includes('internal')) && 'iframe' === previewMode;
456
- const id = generateId(pageName, index++);
457
- const virtualModulePath = (0, external_node_path_namespaceObject.join)(virtualDir, `${id}.${getLangFileExt(node.lang)}`);
458
- constructDemoNode(id, virtualModulePath, node, isMobileMode);
459
- if (external_node_fs_default().existsSync(virtualModulePath)) {
460
- const content = external_node_fs_default().readFileSync(virtualModulePath, 'utf-8');
461
- if (content === value) return;
301
+ ]
302
+ });
303
+ const remarkPlugin_demos = {};
304
+ const remarkCodeToDemo = function({ getRouteMeta, previewMode, defaultRenderMode, position, previewLanguages, previewCodeTransform }) {
305
+ const routeMeta = getRouteMeta();
306
+ __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].mkdirSync(virtualDir, {
307
+ recursive: true
308
+ });
309
+ const data = this.data();
310
+ return (tree, vfile)=>{
311
+ const demoMdx = [];
312
+ const route = routeMeta.find((meta)=>(0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.normalizePosixPath)(meta.absolutePath) === (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.normalizePosixPath)(vfile.path || vfile.history[0]));
313
+ if (!route) return;
314
+ const { pageName } = route;
315
+ remarkPlugin_demos[pageName] = [];
316
+ let title = pageName;
317
+ let index = 1;
318
+ function constructDemoNode(demoId, demoPath, currentNode, isMobileMode, externalDemoIndex) {
319
+ if (isMobileMode) {
320
+ const relativePathReg = new RegExp(/^\.\.?\/.*$/);
321
+ remarkPlugin_demos[pageName].push({
322
+ title,
323
+ id: demoId,
324
+ path: relativePathReg.test(demoPath) ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.resolve)(vfile.dirname || (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.dirname)(vfile.path), demoPath) : demoPath
325
+ });
326
+ } else demoMdx.push(getASTNodeImport(`Demo${demoId}`, demoPath));
327
+ const tempVar = `externalDemoContent${externalDemoIndex}`;
328
+ if (void 0 !== externalDemoIndex) demoMdx.push(getASTNodeImport(tempVar, `!!${demoPath}?raw`));
329
+ if (isMobileMode && 'fixed' === position) void 0 !== externalDemoIndex && Object.assign(currentNode, getExternalDemoContent(tempVar));
330
+ else Object.assign(currentNode, {
331
+ type: 'mdxJsxFlowElement',
332
+ name: 'Container',
333
+ attributes: [
334
+ {
335
+ type: 'mdxJsxAttribute',
336
+ name: 'isMobile',
337
+ value: isMobileMode
338
+ },
339
+ {
340
+ type: 'mdxJsxAttribute',
341
+ name: 'demoId',
342
+ value: demoId
462
343
  }
463
- external_node_fs_default().writeFileSync(virtualModulePath, value);
464
- }
344
+ ],
345
+ children: [
346
+ void 0 === externalDemoIndex ? {
347
+ ...currentNode,
348
+ hasVisited: true
349
+ } : getExternalDemoContent(tempVar),
350
+ isMobileMode ? {
351
+ type: 'mdxJsxFlowElement',
352
+ name: null
353
+ } : {
354
+ type: 'mdxJsxFlowElement',
355
+ name: `Demo${demoId}`
356
+ }
357
+ ]
465
358
  });
466
- tree.children.unshift(...demoMdx);
467
- if (remarkPlugin_demos[pageName].length > 0) data.pageMeta.haveDemos = true;
468
- };
359
+ }
360
+ lib_visit(tree, 'heading', (node)=>{
361
+ if (1 === node.depth) {
362
+ const firstChild = node.children[0];
363
+ title = firstChild && 'value' in firstChild && firstChild.value || title;
364
+ }
365
+ });
366
+ lib_visit(tree, 'code', (node)=>{
367
+ if ('hasVisited' in node) return;
368
+ if (node.lang && previewLanguages.includes(node.lang)) {
369
+ if (node.meta?.includes('pure') || !node.meta?.includes('preview') && 'pure' === defaultRenderMode) return;
370
+ const isJsx = 'jsx' === node.lang || 'tsx' === node.lang;
371
+ const value = isJsx ? injectDemoBlockImport(previewCodeTransform({
372
+ language: node.lang,
373
+ code: node.value
374
+ }), demoBlockComponentPath) : previewCodeTransform({
375
+ language: node.lang,
376
+ code: node.value
377
+ });
378
+ const isMobileMode = node.meta?.includes('mobile') || node.meta?.includes('iframe') || !node.meta?.includes('web') && !node.meta?.includes('internal') && 'iframe' === previewMode;
379
+ const id = generateId(pageName, index++);
380
+ const virtualModulePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(virtualDir, `${id}.${getLangFileExt(node.lang)}`);
381
+ constructDemoNode(id, virtualModulePath, node, isMobileMode);
382
+ if (__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(virtualModulePath)) {
383
+ const content = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(virtualModulePath, 'utf-8');
384
+ if (content === value) return;
385
+ }
386
+ __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].writeFileSync(virtualModulePath, value);
387
+ }
388
+ });
389
+ tree.children.unshift(...demoMdx);
390
+ if (remarkPlugin_demos[pageName].length > 0) data.pageMeta.haveDemos = true;
469
391
  };
470
- let src_routeMeta;
471
- const DEFAULT_PREVIEW_LANGUAGES = [
472
- 'jsx',
473
- 'tsx'
474
- ];
475
- function pluginPreview(options) {
476
- const { isMobile = false, iframeOptions = {}, iframePosition = 'follow', defaultRenderMode = 'preview', previewLanguages = DEFAULT_PREVIEW_LANGUAGES, previewCodeTransform = ({ code })=>code } = options ?? {};
477
- const previewMode = (null == options ? void 0 : options.previewMode) ?? (isMobile ? 'iframe' : 'internal');
478
- const { devPort = 7890, framework = 'react', position = iframePosition, builderConfig = {}, customEntry } = iframeOptions;
479
- const globalUIComponents = 'fixed' === position ? [
480
- (0, external_node_path_namespaceObject.join)(staticPath, 'global-components', 'Device.tsx')
481
- ] : [];
482
- const getRouteMeta = ()=>src_routeMeta;
483
- let lastDemos;
484
- let devServer;
485
- let clientConfig;
486
- const port = devPort;
487
- return {
488
- name: '@rspress/plugin-preview',
489
- config (config) {
490
- config.markdown = config.markdown || {};
491
- config.markdown.mdxRs = false;
492
- return config;
493
- },
494
- routeGenerated (routes) {
495
- src_routeMeta = routes;
496
- },
497
- async beforeBuild (_, isProd) {
498
- if (!isProd) try {
499
- await new Promise((resolve, reject)=>{
500
- const server = external_node_net_default().createServer();
501
- server.unref();
502
- server.on('error', reject);
503
- server.listen({
504
- port,
505
- host: '0.0.0.0'
506
- }, ()=>{
507
- server.close(resolve);
508
- });
392
+ };
393
+ let src_routeMeta;
394
+ const DEFAULT_PREVIEW_LANGUAGES = [
395
+ 'jsx',
396
+ 'tsx'
397
+ ];
398
+ function pluginPreview(options) {
399
+ const { isMobile = false, iframeOptions = {}, iframePosition = 'follow', defaultRenderMode = 'preview', previewLanguages = DEFAULT_PREVIEW_LANGUAGES, previewCodeTransform = ({ code })=>code } = options ?? {};
400
+ const previewMode = options?.previewMode ?? (isMobile ? 'iframe' : 'internal');
401
+ const { devPort = 7890, framework = 'react', position = iframePosition, builderConfig = {}, customEntry } = iframeOptions;
402
+ const globalUIComponents = 'fixed' === position ? [
403
+ (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(staticPath, 'global-components', 'Device.tsx')
404
+ ] : [];
405
+ const getRouteMeta = ()=>src_routeMeta;
406
+ let lastDemos;
407
+ let devServer;
408
+ let clientConfig;
409
+ const port = devPort;
410
+ return {
411
+ name: '@rspress/plugin-preview',
412
+ config (config) {
413
+ config.markdown = config.markdown || {};
414
+ return config;
415
+ },
416
+ routeGenerated (routes) {
417
+ src_routeMeta = routes;
418
+ },
419
+ async beforeBuild (_, isProd) {
420
+ if (!isProd) try {
421
+ await new Promise((resolve, reject)=>{
422
+ const server = __WEBPACK_EXTERNAL_MODULE_node_net_0373943e__["default"].createServer();
423
+ server.unref();
424
+ server.on('error', reject);
425
+ server.listen({
426
+ port,
427
+ host: '0.0.0.0'
428
+ }, ()=>{
429
+ server.close(resolve);
509
430
  });
510
- } catch (e) {
511
- if (!!e && 'object' == typeof e && 'code' in e && 'EADDRINUSE' !== e.code) throw e;
512
- throw new Error(`Port "${port}" is occupied, please choose another one.`);
513
- }
514
- },
515
- async afterBuild (config, isProd) {
516
- var _devServer_server;
517
- if ((0, external_lodash_namespaceObject.isEqual)(remarkPlugin_demos, lastDemos)) return;
518
- lastDemos = (0, external_lodash_namespaceObject.cloneDeep)(remarkPlugin_demos);
519
- await (null == devServer ? void 0 : null == (_devServer_server = devServer.server) ? void 0 : _devServer_server.close());
520
- devServer = void 0;
521
- const sourceEntry = generateEntry(remarkPlugin_demos, framework, position, customEntry);
522
- const outDir = (0, external_node_path_namespaceObject.join)(config.outDir ?? 'doc_build', '~demo');
523
- if (0 === Object.keys(sourceEntry).length) return;
524
- const { html, source, output, performance } = clientConfig ?? {};
525
- const rsbuildConfig = (0, core_namespaceObject.mergeRsbuildConfig)({
526
- dev: {
527
- progressBar: false
528
- },
529
- server: {
530
- port: devPort,
531
- printUrls: ()=>void 0,
532
- strictPort: true
533
- },
534
- performance: {
535
- ...performance,
536
- printFileSize: false
537
- },
538
- html,
539
- source: {
540
- ...source,
541
- entry: sourceEntry
542
- },
543
- output: {
544
- ...output,
545
- assetPrefix: (null == output ? void 0 : output.assetPrefix) ? `${(0, shared_namespaceObject.removeTrailingSlash)(output.assetPrefix)}/~demo` : '/~demo',
546
- distPath: {
547
- root: outDir
548
- },
549
- copy: void 0
550
- },
551
- plugins: null == config ? void 0 : config.builderPlugins
552
- }, builderConfig);
553
- const rsbuildInstance = await (0, core_namespaceObject.createRsbuild)({
554
- rsbuildConfig
555
431
  });
556
- const { pluginSass } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@rsbuild/plugin-sass"));
557
- const { pluginLess } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@rsbuild/plugin-less"));
558
- rsbuildInstance.addPlugins([
559
- pluginSass(),
560
- pluginLess()
561
- ]);
562
- if ('solid' === framework) rsbuildInstance.addPlugins([
563
- (0, plugin_babel_namespaceObject.pluginBabel)({
564
- include: /\.(?:jsx|tsx)$/
565
- }),
566
- (0, plugin_solid_namespaceObject.pluginSolid)()
567
- ]);
568
- if ('react' === framework) rsbuildInstance.addPlugins([
569
- (0, plugin_react_namespaceObject.pluginReact)()
570
- ]);
571
- if (isProd) rsbuildInstance.build();
572
- else devServer = await rsbuildInstance.startDevServer();
573
- },
574
- builderConfig: {
432
+ } catch (e) {
433
+ if (!!e && 'object' == typeof e && 'code' in e && 'EADDRINUSE' !== e.code) throw e;
434
+ throw new Error(`Port "${port}" is occupied, please choose another one.`);
435
+ }
436
+ },
437
+ async afterBuild (config, isProd) {
438
+ if ((0, __WEBPACK_EXTERNAL_MODULE_lodash__.isEqual)(remarkPlugin_demos, lastDemos)) return;
439
+ lastDemos = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.cloneDeep)(remarkPlugin_demos);
440
+ await devServer?.server?.close();
441
+ devServer = void 0;
442
+ const sourceEntry = generateEntry(remarkPlugin_demos, framework, position, customEntry);
443
+ const outDir = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(config.outDir ?? 'doc_build', '~demo');
444
+ if (0 === Object.keys(sourceEntry).length) return;
445
+ const { html, source, output, performance } = clientConfig ?? {};
446
+ const rsbuildConfig = (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)({
447
+ dev: {
448
+ progressBar: false
449
+ },
450
+ server: {
451
+ port: devPort,
452
+ printUrls: ()=>void 0,
453
+ strictPort: true
454
+ },
455
+ performance: {
456
+ ...performance,
457
+ printFileSize: false
458
+ },
459
+ html,
575
460
  source: {
576
- include: [
577
- (0, external_node_path_namespaceObject.join)(__dirname, '..')
578
- ]
461
+ ...source,
462
+ entry: sourceEntry
579
463
  },
580
- tools: {
581
- bundlerChain (chain) {
582
- chain.module.rule('Raw').resourceQuery(/raw/).type('asset/source').end();
583
- chain.resolve.extensions.prepend('.md').prepend('.mdx');
464
+ output: {
465
+ ...output,
466
+ assetPrefix: output?.assetPrefix ? `${(0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.removeTrailingSlash)(output.assetPrefix)}/~demo` : '/~demo',
467
+ distPath: {
468
+ root: outDir
584
469
  },
585
- rspack: {
586
- watchOptions: {
587
- ignored: /\.git/
588
- }
589
- }
470
+ copy: void 0
590
471
  },
591
- plugins: [
592
- {
593
- name: 'close-demo-server',
594
- setup: (api)=>{
595
- api.modifyRsbuildConfig((config)=>{
596
- var _config_output;
597
- if ((null == (_config_output = config.output) ? void 0 : _config_output.target) === 'web') clientConfig = config;
598
- });
599
- api.onCloseDevServer(async ()=>{
600
- var _devServer_server;
601
- await (null == devServer ? void 0 : null == (_devServer_server = devServer.server) ? void 0 : _devServer_server.close());
602
- devServer = void 0;
603
- });
604
- }
605
- }
472
+ plugins: config?.builderPlugins
473
+ }, builderConfig);
474
+ const rsbuildInstance = await (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.createRsbuild)({
475
+ callerName: 'rspress',
476
+ rsbuildConfig
477
+ });
478
+ const { pluginSass } = await import("@rsbuild/plugin-sass");
479
+ const { pluginLess } = await import("@rsbuild/plugin-less");
480
+ rsbuildInstance.addPlugins([
481
+ pluginSass(),
482
+ pluginLess()
483
+ ]);
484
+ if ('solid' === framework) rsbuildInstance.addPlugins([
485
+ (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel_2a5a8b08__.pluginBabel)({
486
+ include: /\.(?:jsx|tsx)$/
487
+ }),
488
+ (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_solid_0a0a2645__.pluginSolid)()
489
+ ]);
490
+ if ('react' === framework) rsbuildInstance.addPlugins([
491
+ (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_react_7b149ee4__.pluginReact)()
492
+ ]);
493
+ if (isProd) rsbuildInstance.build();
494
+ else devServer = await rsbuildInstance.startDevServer();
495
+ },
496
+ builderConfig: {
497
+ source: {
498
+ include: [
499
+ (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(__dirname, '..')
606
500
  ]
607
501
  },
608
- extendPageData (pageData, isProd) {
609
- if (!isProd) pageData.devPort = port;
610
- pageData.extraHighlightLanguages = previewLanguages;
502
+ tools: {
503
+ bundlerChain (chain) {
504
+ chain.module.rule('Raw').resourceQuery(/raw/).type('asset/source').end();
505
+ chain.resolve.extensions.prepend('.md').prepend('.mdx');
506
+ },
507
+ rspack: {
508
+ watchOptions: {
509
+ ignored: /\.git/
510
+ }
511
+ }
611
512
  },
612
- markdown: {
613
- remarkPlugins: [
614
- [
615
- remarkCodeToDemo,
616
- {
617
- getRouteMeta,
618
- position,
619
- previewMode,
620
- defaultRenderMode,
621
- previewLanguages,
622
- previewCodeTransform
623
- }
624
- ]
625
- ],
626
- globalComponents: [
627
- (0, external_node_path_namespaceObject.join)(staticPath, 'global-components', 'Container.tsx')
513
+ plugins: [
514
+ {
515
+ name: 'close-demo-server',
516
+ setup: (api)=>{
517
+ api.modifyRsbuildConfig((config)=>{
518
+ if (config.output?.target === 'web') clientConfig = config;
519
+ });
520
+ api.onCloseDevServer(async ()=>{
521
+ await devServer?.server?.close();
522
+ devServer = void 0;
523
+ });
524
+ }
525
+ }
526
+ ]
527
+ },
528
+ extendPageData (pageData, isProd) {
529
+ if (!isProd) pageData.devPort = port;
530
+ pageData.extraHighlightLanguages = previewLanguages;
531
+ },
532
+ markdown: {
533
+ remarkPlugins: [
534
+ [
535
+ remarkCodeToDemo,
536
+ {
537
+ getRouteMeta,
538
+ position,
539
+ previewMode,
540
+ defaultRenderMode,
541
+ previewLanguages,
542
+ previewCodeTransform
543
+ }
628
544
  ]
629
- },
630
- globalUIComponents,
631
- globalStyles: (0, external_node_path_namespaceObject.join)(staticPath, 'global-styles', `${previewMode}.css`)
632
- };
633
- }
634
- })();
635
- exports.pluginPreview = __webpack_exports__.pluginPreview;
636
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
637
- "pluginPreview"
638
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
639
- Object.defineProperty(exports, '__esModule', {
640
- value: true
641
- });
545
+ ],
546
+ globalComponents: [
547
+ (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(staticPath, 'global-components', 'Container.tsx')
548
+ ]
549
+ },
550
+ globalUIComponents,
551
+ globalStyles: (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(staticPath, 'global-styles', `${previewMode}.css`)
552
+ };
553
+ }
554
+ export { pluginPreview };