@zero-library/common 2.2.13 → 2.2.14

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.cjs.js CHANGED
@@ -1319,10 +1319,15 @@ var VideoPlayer_default = ({ fileUrl }) => {
1319
1319
  "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002"
1320
1320
  ] });
1321
1321
  };
1322
+
1323
+ // src/components/LazyComponent/styles.module.less
1324
+ var styles_module_default2 = {
1325
+ skeleton: "styles_module_skeleton"
1326
+ };
1322
1327
  var baseComponentMap = {
1323
1328
  // renderMarkdown: () => import('@/components/RenderMarkdown')
1324
1329
  };
1325
- var LazyComponent_default = ({ type, customComponents, ...rest }) => {
1330
+ var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }) => {
1326
1331
  const componentMap = React16.useMemo(() => {
1327
1332
  return { ...baseComponentMap, ...customComponents };
1328
1333
  }, [customComponents]);
@@ -1330,11 +1335,14 @@ var LazyComponent_default = ({ type, customComponents, ...rest }) => {
1330
1335
  const loader = componentMap[type];
1331
1336
  return loader ? React16.lazy(loader) : null;
1332
1337
  }, [type, componentMap]);
1333
- if (!LazyComponent) return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1334
- "\u672A\u77E5\u7C7B\u578B\uFF1A",
1335
- type
1336
- ] });
1337
- return /* @__PURE__ */ jsxRuntime.jsx(React16.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "\u52A0\u8F7D\u4E2D..." }), children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...rest }) });
1338
+ if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { message: `\u672A\u77E5\u7C7B\u578B\uFF1A${type}`, type: "warning" });
1339
+ return /* @__PURE__ */ jsxRuntime.jsx(
1340
+ React16.Suspense,
1341
+ {
1342
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default2.skeleton, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", children: "\u7EC4\u4EF6\u52A0\u8F7D\u4E2D..." }) }),
1343
+ children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...rest })
1344
+ }
1345
+ );
1338
1346
  };
1339
1347
  var md = MarkdownIt__default.default({ html: true, breaks: true }).use(markdownItTaskLists__default.default).use(markdownItEmoji.full).use(markdownItFootnote__default.default).use(markdownItDefList__default.default).use(markdownItKatex__default.default);
1340
1348
  md.renderer.rules.link_open = function(tokens, idx, options, env, self) {
@@ -2164,7 +2172,7 @@ var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onC
2164
2172
  };
2165
2173
 
2166
2174
  // src/components/Iframe/styles.module.less
2167
- var styles_module_default2 = {
2175
+ var styles_module_default3 = {
2168
2176
  iframe: "styles_module_iframe"
2169
2177
  };
2170
2178
  var Iframe_default = React16.forwardRef(({ defaultMainSource, id, src, className, onLoad }, ref) => {
@@ -2185,7 +2193,7 @@ var Iframe_default = React16.forwardRef(({ defaultMainSource, id, src, className
2185
2193
  id,
2186
2194
  ref,
2187
2195
  src: finalSrc,
2188
- className: classNames__default.default(styles_module_default2.iframe, className),
2196
+ className: classNames__default.default(styles_module_default3.iframe, className),
2189
2197
  onLoad: onHandleLoad,
2190
2198
  allow: "clipboard-write"
2191
2199
  }