@yuku123/z-frontend-common 1.1.6 → 1.1.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.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  工作区内 **41** 个 `*-suit` 工程通过同一份 AppLayout / LoginPage 获得一致的
6
6
  左菜单架子、登录流程与右上角用户组件;**35** 个 `*-component` 工程声明依赖本包
7
- (其中 **34** 个在源码里真的 import)。
7
+ (其中 **35** 个在源码里真的 import)。
8
8
  **改一处,全仓同步**。
9
9
 
10
10
  ---
@@ -1260,7 +1260,7 @@ const Ue = 240, ge = 96, Ye = { behavior: "smooth", block: "start" }, Ke = `
1260
1260
  l && n.push({ level: o, text: l, id: c(l) });
1261
1261
  }
1262
1262
  return n;
1263
- }, Q = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Q).join("") : e.props ? Q(e.props.children) : "", ue = (e) => String(e).replace(/["\\]/g, "\\$&"), pe = (e, n = Ye) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, Y = /^\s*>\s?(.*)$/, Xe = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1263
+ }, Q = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Q).join("") : e.props ? Q(e.props.children) : "", ue = (e) => String(e).replace(/["\\]/g, "\\$&"), pe = (e, n = Ye) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, Y = /^\s*>\s?(.*)$/, Xe = /(?:!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1264
1264
  let n = String(e).trim();
1265
1265
  return n.startsWith("|") && (n = n.slice(1)), n.endsWith("|") && (n = n.slice(0, -1)), n.split("|").map((c) => c.trim());
1266
1266
  }, Qe = (e) => {
@@ -1384,12 +1384,12 @@ const z = (e, n) => {
1384
1384
  for (const r of e.matchAll(Xe)) {
1385
1385
  if (r.index > i && a(e.slice(i, r.index)), r[1] !== void 0)
1386
1386
  if (r[0].startsWith("!"))
1387
- a(n.img ? n.img({ src: r[3], alt: r[2] }) : /* @__PURE__ */ t("img", { src: r[3], alt: r[2] || "" }));
1387
+ a(n.img ? n.img({ src: r[2], alt: r[1] }) : /* @__PURE__ */ t("img", { src: r[2], alt: r[1] || "" }));
1388
1388
  else {
1389
- const o = z(r[2], n);
1390
- a(n.a ? n.a({ href: r[3], children: o }) : /* @__PURE__ */ t("a", { href: r[3], children: o }));
1389
+ const o = z(r[1], n);
1390
+ a(n.a ? n.a({ href: r[2], children: o }) : /* @__PURE__ */ t("a", { href: r[2], children: o }));
1391
1391
  }
1392
- else r[4] !== void 0 ? a(n.code ? n.code({ children: r[4] }) : /* @__PURE__ */ t("code", { children: r[4] })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("del", { children: z(r[7], n) })) : r[8] !== void 0 ? a(/* @__PURE__ */ t("em", { children: z(r[8], n) })) : r[9] !== void 0 && a(n.a ? n.a({ href: r[9], children: r[9] }) : /* @__PURE__ */ t("a", { href: r[9], children: r[9] }));
1392
+ else r[3] !== void 0 ? a(n.code ? n.code({ children: r[3] }) : /* @__PURE__ */ t("code", { children: r[3] })) : r[4] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[4], n) })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("del", { children: z(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("em", { children: z(r[7], n) })) : r[8] !== void 0 && a(n.a ? n.a({ href: r[8], children: r[8] }) : /* @__PURE__ */ t("a", { href: r[8], children: r[8] }));
1393
1393
  i = r.index + r[0].length;
1394
1394
  }
1395
1395
  return i < e.length && a(e.slice(i)), c;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as be, a as we, D as Ie, b as ke, E as Ce, c as Re, F as ve, G as Le, L as ze, d as Me, P as Be, e as Oe, R as Te, S as je, f as Ee, g as $e, T as De, h as Ke, i as Fe, j as Pe, k as qe, l as He, n as Ne, p as We, r as Ge, s as Je, m as _e, u as Ae } from "./ComponentDoc-wSJwCada.js";
1
+ import { C as be, a as we, D as Ie, b as ke, E as Ce, c as Re, F as ve, G as Le, L as ze, d as Me, P as Be, e as Oe, R as Te, S as je, f as Ee, g as $e, T as De, h as Ke, i as Fe, j as Pe, k as qe, l as He, n as Ne, p as We, r as Ge, s as Je, m as _e, u as Ae } from "./ComponentDoc-Brmekmwk.js";
2
2
  import { jsxs as h, jsx as r } from "react/jsx-runtime";
3
3
  import { Layout as I, Spin as j, Menu as E, Dropdown as $, Avatar as D, Button as k, Tooltip as K, Card as F, Alert as P, Form as x, Input as L, message as S, Tag as q, Result as H } from "antd";
4
4
  import { MenuUnfoldOutlined as N, MenuFoldOutlined as W, DownOutlined as G, LoginOutlined as J, UserOutlined as _, LockOutlined as A } from "@ant-design/icons";
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as e, a as t, D as r, b as o, E as n, c as d, F as i, G as l, L as S, d as u, P as T, e as p, R as b, S as f, f as g, g as c, T as h, h as m, i as C, j as D, k as L, l as E, n as F, p as P, r as A, s as B, m as G, u as I } from "./ComponentDoc-wSJwCada.js";
1
+ import { C as e, a as t, D as r, b as o, E as n, c as d, F as i, G as l, L as S, d as u, P as T, e as p, R as b, S as f, f as g, g as c, T as h, h as m, i as C, j as D, k as L, l as E, n as F, p as P, r as A, s as B, m as G, u as I } from "./ComponentDoc-Brmekmwk.js";
2
2
  export {
3
3
  e as CategoryDot,
4
4
  t as ComponentDoc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuku123/z-frontend-common",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "z-opc 全仓共享前端基座 — AppLayout(§1/§11/§12/§15/§16) + LoginPage(mockAuth 双模式) + EmptyState/StatusTag/ErrorBoundary + createRequest 工厂。lead 008 前端开发规范唯一承载仓",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -153,7 +153,9 @@ const HEADING_RE = /^(#{1,6})\s+(.*?)\s*#*$/
153
153
  const HR_RE = /^\s*([-*_])\s*(\1\s*){2,}$/
154
154
  const LIST_RE = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/
155
155
  const QUOTE_RE = /^\s*>\s?(.*)$/
156
- const INLINE_RE = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g
156
+ // 整条分支必须是非捕获组:外层一旦捕获,粗体/行内代码也会落进「链接」分支,
157
+ // 拿 undefined 的链接文字去递归就直接崩(曾导致所有含 **粗体** 的 DOC.md 白屏)。
158
+ const INLINE_RE = /(?:!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g
157
159
 
158
160
  /** 表格行切列(去掉首尾的 |,逐格 trim)。 */
159
161
  const splitRow = (line) => {
@@ -324,35 +326,35 @@ const renderInline = (text, components) => {
324
326
  for (const m of text.matchAll(INLINE_RE)) {
325
327
  if (m.index > last) push(text.slice(last, m.index))
326
328
  // 分组序号对应 INLINE_RE 的捕获组:
327
- // 1=整段图片/链接 2=alt或链接文字 3=src或href | 4=行内代码
328
- // 5=**粗体** 6=__粗体__ 7=~~删除线~~ 8=*斜体* 9=<自动链接>
329
+ // 1=alt或链接文字 2=src或href | 3=行内代码
330
+ // 4=**粗体** 5=__粗体__ 6=~~删除线~~ 7=*斜体* 8=<自动链接>
329
331
  if (m[1] !== undefined) { // 图片或链接(靠开头的 ! 区分)
330
332
  if (m[0].startsWith('!')) {
331
333
  push(components.img
332
- ? components.img({src: m[3], alt: m[2]})
333
- : <img src={m[3]} alt={m[2] || ''}/>)
334
+ ? components.img({src: m[2], alt: m[1]})
335
+ : <img src={m[2]} alt={m[1] || ''}/>)
334
336
  } else {
335
- const children = renderInline(m[2], components)
337
+ const children = renderInline(m[1], components)
336
338
  push(components.a
337
- ? components.a({href: m[3], children})
338
- : <a href={m[3]}>{children}</a>)
339
+ ? components.a({href: m[2], children})
340
+ : <a href={m[2]}>{children}</a>)
339
341
  }
340
- } else if (m[4] !== undefined) { // 行内代码
342
+ } else if (m[3] !== undefined) { // 行内代码
341
343
  push(components.code
342
- ? components.code({children: m[4]})
343
- : <code>{m[4]}</code>)
344
- } else if (m[5] !== undefined) { // **粗体**
344
+ ? components.code({children: m[3]})
345
+ : <code>{m[3]}</code>)
346
+ } else if (m[4] !== undefined) { // **粗体**
347
+ push(<strong>{renderInline(m[4], components)}</strong>)
348
+ } else if (m[5] !== undefined) { // __粗体__
345
349
  push(<strong>{renderInline(m[5], components)}</strong>)
346
- } else if (m[6] !== undefined) { // __粗体__
347
- push(<strong>{renderInline(m[6], components)}</strong>)
348
- } else if (m[7] !== undefined) { // ~~删除线~~
349
- push(<del>{renderInline(m[7], components)}</del>)
350
- } else if (m[8] !== undefined) { // *斜体*
351
- push(<em>{renderInline(m[8], components)}</em>)
352
- } else if (m[9] !== undefined) { // <自动链接>
350
+ } else if (m[6] !== undefined) { // ~~删除线~~
351
+ push(<del>{renderInline(m[6], components)}</del>)
352
+ } else if (m[7] !== undefined) { // *斜体*
353
+ push(<em>{renderInline(m[7], components)}</em>)
354
+ } else if (m[8] !== undefined) { // <自动链接>
353
355
  push(components.a
354
- ? components.a({href: m[9], children: m[9]})
355
- : <a href={m[9]}>{m[9]}</a>)
356
+ ? components.a({href: m[8], children: m[8]})
357
+ : <a href={m[8]}>{m[8]}</a>)
356
358
  }
357
359
  last = m.index + m[0].length
358
360
  }