dumi 2.3.0-beta.2 → 2.3.0-beta.3
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.
|
@@ -98,10 +98,11 @@ export const demos = {
|
|
|
98
98
|
let { asset } = this;
|
|
99
99
|
const { resolveMap } = this;
|
|
100
100
|
Object.keys(this.resolveMap).forEach((file) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
var _a;
|
|
102
|
+
if (((_a = asset.dependencies[file]) == null ? void 0 : _a.type) === "FILE") {
|
|
103
|
+
asset = import_plugin_utils.lodash.cloneDeep(asset);
|
|
104
|
+
asset.dependencies[file].value = `{{{require('-!${resolveMap[file]}?dumi-raw').default}}}`;
|
|
105
|
+
}
|
|
105
106
|
});
|
|
106
107
|
return JSON.stringify(asset, null, 2).replace(/"{{{|}}}"/g, "");
|
|
107
108
|
},
|
|
@@ -78,6 +78,7 @@ var transformer_default = async (raw, opts) => {
|
|
|
78
78
|
const { default: rehypeAutolinkHeadings } = await import("rehype-autolink-headings");
|
|
79
79
|
const { default: rehypeRemoveComments } = await import("rehype-remove-comments");
|
|
80
80
|
const resolver = import_enhanced_resolve.default.create.sync({
|
|
81
|
+
mainFields: ["browser", "module", "main"],
|
|
81
82
|
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
82
83
|
alias: opts.alias
|
|
83
84
|
});
|
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ var Previewer = function Previewer(props) {
|
|
|
41
41
|
"data-compact": props.compact || undefined,
|
|
42
42
|
"data-transform": props.transform || undefined,
|
|
43
43
|
"data-iframe": props.iframe || undefined,
|
|
44
|
+
"data-error": Boolean(combineError) || undefined,
|
|
44
45
|
ref: demoContainer
|
|
45
46
|
}, props.iframe ? /*#__PURE__*/React.createElement("iframe", {
|
|
46
47
|
style: ['string', 'number'].includes(_typeof(props.iframe)) ? {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@import (reference) '../../styles/variables.less';
|
|
2
2
|
|
|
3
3
|
.@{prefix}-previewer {
|
|
4
|
+
@error-bar-height: 30px;
|
|
5
|
+
|
|
4
6
|
margin: 24px 0 32px;
|
|
5
7
|
border: 1px solid @c-border-light;
|
|
6
8
|
border-radius: 4px;
|
|
@@ -76,16 +78,26 @@
|
|
|
76
78
|
&[data-compact] {
|
|
77
79
|
padding: 0;
|
|
78
80
|
}
|
|
81
|
+
|
|
82
|
+
// error status
|
|
83
|
+
&[data-error][data-compact] {
|
|
84
|
+
min-height: @error-bar-height;
|
|
85
|
+
|
|
86
|
+
+ .@{prefix}-previewer-demo-error {
|
|
87
|
+
border-top-left-radius: 3px;
|
|
88
|
+
border-top-right-radius: 3px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
&-demo-error {
|
|
82
|
-
@height: 30px;
|
|
83
94
|
@color: darken(desaturate(@c-error, 20%), 1%);
|
|
84
95
|
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
position: relative;
|
|
97
|
+
margin-top: -@error-bar-height;
|
|
98
|
+
height: @error-bar-height;
|
|
87
99
|
padding: 0 24px;
|
|
88
|
-
line-height: @height;
|
|
100
|
+
line-height: @error-bar-height;
|
|
89
101
|
color: @color;
|
|
90
102
|
font-size: 13px;
|
|
91
103
|
white-space: nowrap;
|