dumi 2.2.16 → 2.2.17

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.
@@ -126,7 +126,7 @@ var ColorChanger = /*#__PURE__*/function () {
126
126
  }
127
127
  this.prefersColor = color;
128
128
  this.color = color === 'auto' ? this.isColorMode('dark') ? 'dark' : 'light' : color;
129
- document.documentElement.setAttribute(PREFERS_COLOR_ATTR, color);
129
+ document.documentElement.setAttribute(PREFERS_COLOR_ATTR, this.color);
130
130
  this.applyCallbacks();
131
131
  return color;
132
132
  }
@@ -76,22 +76,24 @@ var compile_default = (api) => {
76
76
  locales: api.config.locales,
77
77
  pkg: api.pkg
78
78
  };
79
- memo.module.rule("dumi-md").type("javascript/auto").test(/\.md$/).oneOf("md-meta").resourceQuery(/meta$/).use("babel-loader").loader(babelInUmi.loader).options(babelInUmi.options).end().use("md-meta-loader").loader(loaderPath).options({
80
- ...loaderBaseOpts,
81
- mode: "meta",
82
- onResolveDemos(demos) {
83
- const assets = demos.reduce(
84
- (ret, demo) => {
79
+ memo.module.rule("dumi-md").type("javascript/auto").test(/\.md$/).oneOf("md-meta").resourceQuery(/meta$/).use("babel-loader").loader(babelInUmi.loader).options(babelInUmi.options).end().use("md-meta-loader").loader(loaderPath).options(
80
+ api.isPluginEnable("assets") || api.isPluginEnable("exportStatic") ? {
81
+ ...loaderBaseOpts,
82
+ mode: "meta",
83
+ onResolveDemos(demos) {
84
+ const assets = demos.reduce((ret, demo) => {
85
85
  if ("asset" in demo)
86
86
  ret.push(demo.asset);
87
87
  return ret;
88
- },
89
- []
90
- );
91
- (0, import_assets.addExampleAssets)(assets);
92
- },
93
- onResolveAtomMeta: import_assets.addAtomMeta
94
- }).end().end().oneOf("md").use("babel-loader").loader(babelInUmi.loader).options(babelInUmi.options).end().use("md-loader").loader(loaderPath).options({
88
+ }, []);
89
+ (0, import_assets.addExampleAssets)(assets);
90
+ },
91
+ onResolveAtomMeta: import_assets.addAtomMeta
92
+ } : {
93
+ ...loaderBaseOpts,
94
+ mode: "meta"
95
+ }
96
+ ).end().end().oneOf("md").use("babel-loader").loader(babelInUmi.loader).options(babelInUmi.options).end().use("md-loader").loader(loaderPath).options({
95
97
  ...loaderBaseOpts,
96
98
  builtins: api.service.themeData.builtins
97
99
  });
@@ -121,6 +121,9 @@ var depsMapping = {};
121
121
  function mdLoader(content) {
122
122
  const opts = this.getOptions();
123
123
  const cb = this.async();
124
+ if (process.env.NODE_ENV === "production" && ["onResolveDemos", "onResolveAtomMeta"].some((k) => k in opts)) {
125
+ this.cacheable(false);
126
+ }
124
127
  const cache = (0, import_utils.getCache)("md-loader");
125
128
  const baseCacheKey = [
126
129
  this.resourcePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.2.16",
3
+ "version": "2.2.17",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",
@@ -56,7 +56,10 @@
56
56
  background-color: @c-site-bg-dark;
57
57
  box-shadow: 0 0 0 3px fade(@c-primary-dark, 10%);
58
58
  }
59
+ }
59
60
 
61
+ &:focus,
62
+ &:not(:placeholder-shown) {
60
63
  ~ .@{prefix}-search-shortcut {
61
64
  opacity: 0;
62
65
  }