dumi 2.3.6 → 2.3.7
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.
|
@@ -138,15 +138,17 @@ export function getRouteMetaById<T extends { syncOnly?: boolean }>(
|
|
|
138
138
|
id: string,
|
|
139
139
|
opts?: T,
|
|
140
140
|
): T extends { syncOnly: true }
|
|
141
|
-
? IRouteMeta
|
|
142
|
-
: Promise<IRouteMeta>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
frontmatter,
|
|
147
|
-
toc: toc,
|
|
141
|
+
? IRouteMeta
|
|
142
|
+
: Promise<IRouteMeta> {
|
|
143
|
+
const routeMeta: IRouteMeta = {
|
|
144
|
+
frontmatter: {},
|
|
145
|
+
toc: [],
|
|
148
146
|
texts: [],
|
|
149
147
|
};
|
|
148
|
+
if (filesMeta[id]) {
|
|
149
|
+
const { frontmatter, toc, textGetter, tabs } = filesMeta[id];
|
|
150
|
+
routeMeta.frontmatter = frontmatter;
|
|
151
|
+
routeMeta.toc = toc;
|
|
150
152
|
|
|
151
153
|
if (opts?.syncOnly) {
|
|
152
154
|
if (tabs) {
|
|
@@ -174,6 +176,10 @@ export function getRouteMetaById<T extends { syncOnly?: boolean }>(
|
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
178
|
}
|
|
179
|
+
if (opts?.syncOnly) {
|
|
180
|
+
return routeMeta;
|
|
181
|
+
}
|
|
182
|
+
return Promise.resolve(routeMeta);
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
/**
|
package/package.json
CHANGED
|
@@ -262,7 +262,7 @@ var API = function API(props) {
|
|
|
262
262
|
id: 'api.component.description'
|
|
263
263
|
})), /*#__PURE__*/React.createElement("th", null, intl.formatMessage({
|
|
264
264
|
id: 'api.component.type'
|
|
265
|
-
})),
|
|
265
|
+
})), type === 'props' && /*#__PURE__*/React.createElement("th", null, intl.formatMessage({
|
|
266
266
|
id: 'api.component.default'
|
|
267
267
|
})))), /*#__PURE__*/React.createElement("tbody", null, Object.keys(properties).length ? Object.entries(properties).map(function (_ref9) {
|
|
268
268
|
var _definition$propsConf;
|
|
@@ -274,7 +274,7 @@ var API = function API(props) {
|
|
|
274
274
|
}, /*#__PURE__*/React.createElement("td", null, releaseInfo[name] ? /*#__PURE__*/React.createElement(APIRelease, {
|
|
275
275
|
name: name,
|
|
276
276
|
info: releaseInfo[name]
|
|
277
|
-
}) : name), /*#__PURE__*/React.createElement("td", null, prop.description || '--'), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(APIType, prop)),
|
|
277
|
+
}) : name), /*#__PURE__*/React.createElement("td", null, prop.description || '--'), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(APIType, prop)), type === 'props' && /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("code", null, (_definition$propsConf = definition.propsConfig.required) !== null && _definition$propsConf !== void 0 && _definition$propsConf.includes(name) ? intl.formatMessage({
|
|
278
278
|
id: 'api.component.required'
|
|
279
279
|
}) : JSON.stringify(prop.default) || '--')));
|
|
280
280
|
}) : /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|