@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/README.md +1 -1
- package/dist/index.js +475 -562
- package/dist/utils.js +1 -47
- package/package.json +23 -16
- package/static/global-components/Container.tsx +1 -1
- package/static/global-styles/entry.css +22 -5
package/dist/index.js
CHANGED
@@ -1,128 +1,66 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
15
|
-
|
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
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
-
|
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
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
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
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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 <
|
174
|
-
return
|
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
|
-
|
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
|
-
|
207
|
-
|
127
|
+
}
|
128
|
+
function typeFactory(check) {
|
129
|
+
return castFactory(type);
|
130
|
+
function type(node) {
|
131
|
+
return node && node.type === check;
|
208
132
|
}
|
209
|
-
|
210
|
-
|
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
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
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
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
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
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
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
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
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
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
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
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
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
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
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
|
-
|
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
|
-
|
467
|
-
|
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
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
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
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
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
|
-
|
577
|
-
|
578
|
-
]
|
461
|
+
...source,
|
462
|
+
entry: sourceEntry
|
579
463
|
},
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
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
|
-
|
586
|
-
watchOptions: {
|
587
|
-
ignored: /\.git/
|
588
|
-
}
|
589
|
-
}
|
470
|
+
copy: void 0
|
590
471
|
},
|
591
|
-
plugins:
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
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
|
-
|
609
|
-
|
610
|
-
|
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
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
{
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
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
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
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 };
|