@huibo-ui/react-antd 1.0.8 → 1.0.9

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.
@@ -76,5 +76,5 @@ export function ConfigProvider(props) {
76
76
  React.useEffect(() => {
77
77
  applyThemeToken(theme?.token);
78
78
  }, [theme?.token]);
79
- return (_jsx(HbConfigProvider, { theme: theme?.dark ? 'dark' : 'light', size: props.componentSize === 'middle' ? 'default' : props.componentSize, locale: props.locale ? 'zh-CN' : 'en-US', children: _jsx("div", { style: { display: 'block', width: '100%', height: '100%' }, children: children }) }));
79
+ return (_jsx(HbConfigProvider, { theme: theme?.dark ? 'dark' : 'light', size: props.componentSize === 'middle' ? 'default' : props.componentSize, locale: props.locale ? 'zh-CN' : 'en-US', children: _jsx("div", { style: { display: 'contents' }, children: children }) }));
80
80
  }
@@ -3,11 +3,28 @@
3
3
  * message.success('保存成功') → 创建 hb-message 并显示
4
4
  */
5
5
  let messageCounter = 0;
6
+ /**
7
+ * 获取/创建固定定位的 message 容器(与主包 show-message.ts 的 #hb-message-container 对齐)。
8
+ * 命令式 message 必须脱离文档流固定在视口顶部居中,否则会被 body 内容流推到视口外,
9
+ * 用户看不到提示(表现为「点了没反应」)。
10
+ */
11
+ function getMessageContainer() {
12
+ let container = document.getElementById('hb-message-container');
13
+ if (!container) {
14
+ container = document.createElement('div');
15
+ container.id = 'hb-message-container';
16
+ container.style.cssText =
17
+ 'position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:1100;' +
18
+ 'display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;';
19
+ document.body.appendChild(container);
20
+ }
21
+ return container;
22
+ }
6
23
  function showMessage(type, content, duration) {
7
24
  const id = `hb-msg-${++messageCounter}`;
8
25
  const div = document.createElement('div');
9
26
  div.id = id;
10
- document.body.appendChild(div);
27
+ getMessageContainer().appendChild(div);
11
28
  // 创建 hb-message 元素
12
29
  const el = document.createElement('hb-message');
13
30
  el.type = type;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huibo-ui/react-antd",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "antd 兼容层 — 接收 antd 原生 props,内部转换为 huibo-ui,实现丝滑平替",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",