@baishuyun/ui-base 6.31.0 → 6.32.1

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.
@@ -1,20 +1,20 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { jsx as e } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import { Component as n, useCallback as r, useEffect as i, useLayoutEffect as a, useMemo as ee, useRef as o } from "react";
5
- import { createRoot as te } from "react-dom/client";
6
- import * as s from "@babel/standalone";
7
- import { parse as c, walk as l } from "css-tree";
8
- import * as u from "lucide-react";
4
+ import { Component as n, useCallback as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s } from "react";
5
+ import { createRoot as ee } from "react-dom/client";
6
+ import * as c from "@babel/standalone";
7
+ import { parse as l, walk as u } from "css-tree";
8
+ import * as d from "lucide-react";
9
9
  //#region ../shared/src/ai-runtime/moduleNames.ts
10
- var d = ["react", "lucide-react"], f = new Set(d), p = d.join("、"), m = [
10
+ var f = ["react", "lucide-react"], p = new Set(f), m = f.join("、"), h = [
11
11
  "value",
12
12
  "onChange",
13
13
  "disabled",
14
14
  "readOnly",
15
15
  "formData",
16
- "tableMode"
17
- ], h = new Set([
16
+ "env"
17
+ ], g = new Set([
18
18
  "fetch",
19
19
  "XMLHttpRequest",
20
20
  "WebSocket",
@@ -27,13 +27,13 @@ var d = ["react", "lucide-react"], f = new Set(d), p = d.join("、"), m = [
27
27
  "localStorage",
28
28
  "sessionStorage",
29
29
  "indexedDB"
30
- ]), g = new Set([
30
+ ]), _ = new Set([
31
31
  "script",
32
32
  "iframe",
33
33
  "object",
34
34
  "embed",
35
35
  "link"
36
- ]), _ = new Set([
36
+ ]), v = new Set([
37
37
  "loc",
38
38
  "start",
39
39
  "end",
@@ -42,77 +42,77 @@ var d = ["react", "lucide-react"], f = new Set(d), p = d.join("、"), m = [
42
42
  "leadingComments",
43
43
  "trailingComments",
44
44
  "innerComments"
45
- ]), v = /url\(\s*['"]?\s*(?:https?:)?\/\//i, y = (e) => e?.type === "FunctionDeclaration" || e?.type === "FunctionExpression" || e?.type === "ArrowFunctionExpression";
46
- function b(e, t) {
45
+ ]), y = /url\(\s*['"]?\s*(?:https?:)?\/\//i, b = (e) => e?.type === "FunctionDeclaration" || e?.type === "FunctionExpression" || e?.type === "ArrowFunctionExpression";
46
+ function x(e, t) {
47
47
  if (!(!e || typeof e.type != "string") && t(e) !== !1) for (let n of Object.keys(e)) {
48
- if (_.has(n)) continue;
48
+ if (v.has(n)) continue;
49
49
  let r = e[n];
50
- Array.isArray(r) ? r.forEach((e) => b(e, t)) : r && typeof r == "object" && b(r, t);
50
+ Array.isArray(r) ? r.forEach((e) => x(e, t)) : r && typeof r == "object" && x(r, t);
51
51
  }
52
52
  }
53
- function x(e) {
53
+ function S(e) {
54
54
  let t = e.body.find((e) => e.type === "ExportDefaultDeclaration")?.declaration;
55
55
  if (!t) return null;
56
- if (y(t)) return t;
56
+ if (b(t)) return t;
57
57
  if (t.type !== "Identifier") return null;
58
58
  for (let n of e.body) {
59
59
  if (n.type === "FunctionDeclaration" && n.id?.name === t.name) return n;
60
60
  if (n.type === "VariableDeclaration") {
61
- let e = n.declarations.find((e) => e.id?.name === t.name && y(e.init));
61
+ let e = n.declarations.find((e) => e.id?.name === t.name && b(e.init));
62
62
  if (e) return e.init;
63
63
  }
64
64
  }
65
65
  return null;
66
66
  }
67
- var S = (e) => e.computed ? null : e.key.type === "Identifier" ? e.key.name : e.key.type === "StringLiteral" ? e.key.value : null, C = (e) => e ? e.type === "Identifier" ? e.name : e.type === "StringLiteral" ? e.value : e.type === "TemplateLiteral" && e.expressions.length === 0 ? e.quasis[0]?.value?.cooked ?? null : null : null;
68
- function w(e, t, n) {
67
+ var C = (e) => e.computed ? null : e.key.type === "Identifier" ? e.key.name : e.key.type === "StringLiteral" ? e.key.value : null, w = (e) => e ? e.type === "Identifier" ? e.name : e.type === "StringLiteral" ? e.value : e.type === "TemplateLiteral" && e.expressions.length === 0 ? e.quasis[0]?.value?.cooked ?? null : null : null;
68
+ function T(e, t, n) {
69
69
  for (let r of e.properties) {
70
70
  if (r.type === "RestElement") {
71
- n.push(`组件不能用 ...rest 收集 props,请只解构 ${m.join("、")}。`);
71
+ n.push(`组件不能用 ...rest 收集 props,请只解构 ${h.join("、")}。`);
72
72
  continue;
73
73
  }
74
- let e = S(r);
75
- e === null ? n.push("组件的 props 不能使用计算属性名。") : m.includes(e) || t.add(e);
74
+ let e = C(r);
75
+ e === null ? n.push("组件的 props 不能使用计算属性名。") : h.includes(e) || t.add(e);
76
76
  }
77
77
  }
78
- function T(e) {
78
+ function E(e) {
79
79
  let t = [], n = /* @__PURE__ */ new Set(), [r] = e.params;
80
- return e.params.length > 1 && t.push("组件只接收一个 props 参数,不能有第二个参数(如 ref)。"), r?.type === "AssignmentPattern" && (r = r.left), r?.type === "ObjectPattern" ? w(r, n, t) : r?.type === "Identifier" && b(e.body, (e) => {
80
+ return e.params.length > 1 && t.push("组件只接收一个 props 参数,不能有第二个参数(如 ref)。"), r?.type === "AssignmentPattern" && (r = r.left), r?.type === "ObjectPattern" ? T(r, n, t) : r?.type === "Identifier" && x(e.body, (e) => {
81
81
  if (e.type === "MemberExpression" && e.object?.name === r.name) {
82
82
  let r = e.computed ? null : e.property.name;
83
- return r === null ? t.push("组件不能用动态键读取 props。") : m.includes(r) || n.add(r), !1;
83
+ return r === null ? t.push("组件不能用动态键读取 props。") : h.includes(r) || n.add(r), !1;
84
84
  }
85
- return e.type === "VariableDeclarator" && e.init?.name === r.name && e.id.type === "ObjectPattern" ? (w(e.id, n, t), !1) : !0;
86
- }), n.size && t.unshift(`组件签名只能接收 ${m.join("、")},发现多余的 props:${[...n].join("、")}。平台不会传入它们,请删除,需要的文案或配置直接写在组件内部。`), t;
85
+ return e.type === "VariableDeclarator" && e.init?.name === r.name && e.id.type === "ObjectPattern" ? (T(e.id, n, t), !1) : !0;
86
+ }), n.size && t.unshift(`组件签名只能接收 ${h.join("、")},发现多余的 props:${[...n].join("、")}。平台不会传入它们,请删除,需要的文案或配置直接写在组件内部。`), t;
87
87
  }
88
- function E(e) {
88
+ function D(e) {
89
89
  let t = /* @__PURE__ */ new Set(), n = (e) => {
90
90
  switch (e.type) {
91
- case "Identifier": return h.has(e.name) && t.add(e.name), !0;
91
+ case "Identifier": return g.has(e.name) && t.add(e.name), !0;
92
92
  case "MemberExpression":
93
- case "OptionalMemberExpression": return C(e.property) === "constructor" && t.add("constructor"), e.computed ? !0 : (b(e.object, n), !1);
94
- case "ObjectProperty": return e.computed ? !0 : (b(e.value, n), !1);
95
- case "ImportDeclaration": return f.has(e.source.value) || t.add(`import "${e.source.value}"(只能 import ${p})`), !1;
93
+ case "OptionalMemberExpression": return w(e.property) === "constructor" && t.add("constructor"), e.computed ? !0 : (x(e.object, n), !1);
94
+ case "ObjectProperty": return e.computed ? !0 : (x(e.value, n), !1);
95
+ case "ImportDeclaration": return p.has(e.source.value) || t.add(`import "${e.source.value}"(只能 import ${m})`), !1;
96
96
  case "Import":
97
97
  case "ImportExpression": return t.add("动态 import()"), !0;
98
98
  case "JSXOpeningElement": {
99
99
  let n = e.name?.name;
100
- return n === "textarea" ? t.add("<textarea>(单行文本的值不能包含换行)") : g.has(n) && t.add(`<${n}>`), !0;
100
+ return _.has(n) && t.add(`<${n}>`), !0;
101
101
  }
102
102
  case "JSXAttribute": return e.name?.name === "dangerouslySetInnerHTML" && t.add("dangerouslySetInnerHTML"), !0;
103
103
  default: return !0;
104
104
  }
105
105
  };
106
- return b(e, n), [...t];
106
+ return x(e, n), [...t];
107
107
  }
108
- function D(e) {
108
+ function O(e) {
109
109
  let t = [];
110
- return /@import\b/i.test(e) && t.push("CSS 中不能使用 @import。"), v.test(e) && t.push("CSS 中不能引用外部地址,图片请用内联 svg 或 data: 地址。"), t;
110
+ return /@import\b/i.test(e) && t.push("CSS 中不能使用 @import。"), y.test(e) && t.push("CSS 中不能引用外部地址,图片请用内联 svg 或 data: 地址。"), t;
111
111
  }
112
- function O(e, t = null) {
112
+ function k(e, t = null) {
113
113
  let n = [], r = null;
114
114
  try {
115
- r = s.packages.parser.parse(e, {
115
+ r = c.packages.parser.parse(e, {
116
116
  sourceType: "module",
117
117
  plugins: ["jsx"]
118
118
  }).program;
@@ -120,21 +120,21 @@ function O(e, t = null) {
120
120
  if (!(e instanceof SyntaxError)) throw e;
121
121
  }
122
122
  if (r) {
123
- let e = x(r);
124
- e && n.push(...T(e));
125
- let t = E(r);
123
+ let e = S(r);
124
+ e && n.push(...E(e));
125
+ let t = D(r);
126
126
  t.length && n.push(`不允许使用:${t.join("、")}。组件不能发起网络请求、使用 eval 或 Function,也不能读取 constructor 或注入脚本和原始 HTML。`);
127
127
  }
128
- return t != null && n.push(...D(t)), n;
128
+ return t != null && n.push(...O(t)), n;
129
129
  }
130
- function k(e, t = null) {
131
- let n = O(e, t);
130
+ function A(e, t = null) {
131
+ let n = k(e, t);
132
132
  if (n.length) throw Error(`组件不符合运行时约束:\n${n.map((e) => `- ${e}`).join("\n")}`);
133
133
  }
134
134
  //#endregion
135
135
  //#region ../shared/src/ai-runtime/checkCssSyntax.ts
136
- function A(e, t = "style.css") {
137
- e?.trim() && l(c(e, {
136
+ function j(e, t = "style.css") {
137
+ e?.trim() && u(l(e, {
138
138
  filename: t,
139
139
  positions: !0,
140
140
  onParseError(e) {
@@ -147,10 +147,10 @@ function A(e, t = "style.css") {
147
147
  }
148
148
  //#endregion
149
149
  //#region ../shared/src/ai-runtime/sourceText.ts
150
- var j = /function\s+([A-Za-z_$][\w$]*)/, ne = /export\s+default\b/;
151
- function M(e) {
152
- if (!e || ne.test(e)) return e;
153
- let t = e.match(j)?.[1];
150
+ var M = /function\s+([A-Za-z_$][\w$]*)/, te = /export\s+default\b/;
151
+ function ne(e) {
152
+ if (!e || te.test(e)) return e;
153
+ let t = e.match(M)?.[1];
154
154
  return t ? `${e.trim()}\nexport default ${t};\n` : e;
155
155
  }
156
156
  //#endregion
@@ -180,9 +180,9 @@ var ae = "export default function AiRuntimeField() {\n return null;\n}";
180
180
  function P(e, t = "ai") {
181
181
  let n = N(e);
182
182
  if (!n) throw Error("code 里没有可用的 <jsx> 或 <css>。");
183
- let r = M(n.jsx || ae), i = n.css ?? "";
184
- i && A(i, `${t}.css`), k(r, i || null);
185
- let a = s.transform(r, {
183
+ let r = ne(n.jsx || ae), i = n.css ?? "";
184
+ i && j(i, `${t}.css`), A(r, i || null);
185
+ let a = c.transform(r, {
186
186
  ...ie,
187
187
  filename: `${t}.jsx`
188
188
  });
@@ -194,15 +194,15 @@ function P(e, t = "ai") {
194
194
  }
195
195
  //#endregion
196
196
  //#region ../shared/src/ai-runtime/compileCache.ts
197
- var F = 200, I = /* @__PURE__ */ new Map(), oe = Object.freeze({
197
+ var oe = 200, F = /* @__PURE__ */ new Map(), se = Object.freeze({
198
198
  ok: !1,
199
199
  code: "",
200
200
  css: "",
201
201
  error: null
202
- }), L = (e, t) => {
203
- if (typeof e != "string" || !e.trim()) return oe;
204
- let n = I.get(e);
205
- if (n) return I.delete(e), I.set(e, n), n;
202
+ }), I = (e, t) => {
203
+ if (typeof e != "string" || !e.trim()) return se;
204
+ let n = F.get(e);
205
+ if (n) return F.delete(e), F.set(e, n), n;
206
206
  let r;
207
207
  try {
208
208
  let n = P(e, t);
@@ -220,118 +220,125 @@ var F = 200, I = /* @__PURE__ */ new Map(), oe = Object.freeze({
220
220
  error: e
221
221
  };
222
222
  }
223
- if (I.size >= F) {
224
- let e = I.keys().next().value;
225
- e !== void 0 && I.delete(e);
223
+ if (F.size >= oe) {
224
+ let e = F.keys().next().value;
225
+ e !== void 0 && F.delete(e);
226
226
  }
227
- return I.set(e, r), r;
228
- }, se = () => {
229
- I.clear();
230
- }, R = (e, t) => {
227
+ return F.set(e, r), r;
228
+ }, ce = () => {
229
+ F.clear();
230
+ }, L = (e, t) => {
231
231
  let n = {};
232
232
  for (let t of Object.keys(e)) n[t] = e[t];
233
233
  return (n.default === void 0 || n.default === null) && (n.default = t), Object.defineProperty(n, "__esModule", { value: !0 }), n;
234
- }, z = t.default || t, ce = {
235
- react: R(t, z),
236
- "lucide-react": R(u, u)
237
- }, B = {};
238
- for (let e of d) {
239
- let t = ce[e];
234
+ }, R = t.default || t, le = {
235
+ react: L(t, R),
236
+ "lucide-react": L(d, d)
237
+ }, z = {};
238
+ for (let e of f) {
239
+ let t = le[e];
240
240
  if (!t) throw Error(`模块 ${e} 在白名单里但没有实现。`);
241
- B[e] = t;
241
+ z[e] = t;
242
242
  }
243
- var V = Object.keys(B), H = (e) => {
244
- let t = B[e];
243
+ var B = Object.keys(z), V = (e) => {
244
+ let t = z[e];
245
245
  if (t) return t;
246
- throw Error(`Unknown module: ${e}(组件只能 require ${V.join("、")})`);
247
- }, U = {
246
+ throw Error(`Unknown module: ${e}(组件只能 require ${B.join("、")})`);
247
+ }, H = {
248
248
  COMPILE: 4001,
249
249
  EXECUTE: 4002,
250
250
  RENDER: 5001,
251
251
  RUNTIME: 5002
252
- }, W = new Set(Object.values(U)), G = (e, t) => {
252
+ }, U = new Set(Object.values(H)), W = (e, t) => {
253
253
  let n = e instanceof Error ? e : Error(String(e)), r = n.code;
254
- return (typeof r != "number" || !W.has(r)) && (n.code = t), n;
255
- }, K = 0, le = (e) => (K += 1, `ai-runtime-${e}-${K}.js`), ue = (e, t) => {
254
+ return (typeof r != "number" || !U.has(r)) && (n.code = t), n;
255
+ }, G = 0, ue = (e) => (G += 1, `ai-runtime-${e}-${G}.js`), de = (e, t) => {
256
256
  if (!e) throw Error("没有可执行的代码。");
257
257
  let n = {}, r = `${e}\n//# sourceURL=${t}`;
258
- if (Function("require", "exports", "React", r)(H, n, z), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
258
+ if (Function("require", "exports", "React", r)(V, n, R), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
259
259
  return n.default;
260
- }, q = /* @__PURE__ */ new Map(), J = !1, Y = /* @__PURE__ */ new WeakSet(), de = (e) => {
261
- e && typeof e == "object" && Y.add(e);
262
- }, X = (e) => {
263
- if (e && typeof e == "object" && Y.has(e)) return;
260
+ }, K = /* @__PURE__ */ new Map(), q = !1, J = /* @__PURE__ */ new WeakSet(), fe = (e) => {
261
+ e && typeof e == "object" && J.add(e);
262
+ }, Y = (e) => {
263
+ if (e && typeof e == "object" && J.has(e)) return;
264
264
  let t = e instanceof Error ? e.stack : void 0;
265
265
  if (typeof t == "string") {
266
- for (let [n, r] of q) if (t.includes(n)) {
267
- r(G(e, U.RUNTIME));
266
+ for (let [n, r] of K) if (t.includes(n)) {
267
+ r(W(e, H.RUNTIME));
268
268
  return;
269
269
  }
270
270
  }
271
- }, fe = () => {
272
- J || typeof window > "u" || (J = !0, window.addEventListener("error", (e) => {
271
+ }, pe = () => {
272
+ q || typeof window > "u" || (q = !0, window.addEventListener("error", (e) => {
273
273
  let t = e.error || Error(e.message);
274
- queueMicrotask(() => X(t));
274
+ queueMicrotask(() => Y(t));
275
275
  }), window.addEventListener("unhandledrejection", (e) => {
276
276
  let t = e.reason;
277
- queueMicrotask(() => X(t));
277
+ queueMicrotask(() => Y(t));
278
278
  }));
279
- }, pe = (e, t) => {
280
- fe(), q.set(e, t);
281
- }, me = (e) => {
282
- q.delete(e);
283
- }, he = /(^|[\s,>+~(])(?::root\b|html\b|body\b)/gi, Z = (e) => typeof e != "string" || !e ? "" : e.replace(he, "$1:host"), ge = typeof window > "u" ? i : a, _e = class extends n {
279
+ }, me = (e, t) => {
280
+ pe(), K.set(e, t);
281
+ }, he = (e) => {
282
+ K.delete(e);
283
+ }, ge = /(^|[\s,>+~(])(?::root\b|html\b|body\b)/gi, X = (e) => typeof e != "string" || !e ? "" : e.replace(ge, "$1:host"), _e = typeof window > "u" ? i : a, ve = class extends n {
284
284
  state = { failed: !1 };
285
285
  static getDerivedStateFromError() {
286
286
  return { failed: !0 };
287
287
  }
288
288
  componentDidCatch(e) {
289
- de(e), this.props.onError(G(e, U.RENDER));
289
+ fe(e), this.props.onError(W(e, H.RENDER));
290
290
  }
291
291
  render() {
292
292
  return this.state.failed ? null : this.props.children;
293
293
  }
294
- }, Q = (e, t) => {
294
+ }, Z = new Set([
295
+ "form",
296
+ "table",
297
+ "card"
298
+ ]), ye = (e) => ({
299
+ view: Z.has(e?.view) ? e?.view : "form",
300
+ platform: e?.platform === "mobile" ? "mobile" : "pc"
301
+ }), Q = (e, t) => {
295
302
  let n = e ?? {};
296
303
  return {
297
304
  value: n.value ?? "",
298
305
  disabled: !!n.disabled,
299
306
  readOnly: !!n.readOnly,
300
307
  formData: n.formData || {},
301
- tableMode: !!n.tableMode,
308
+ env: ye(n.env),
302
309
  onChange: t
303
310
  };
304
- }, ve = {
311
+ }, be = {
305
312
  ok: !1,
306
313
  error: null,
307
314
  Component: null
308
315
  };
309
- function ye(t) {
310
- let n = ({ code: n, value: a, disabled: s, readOnly: c, formData: l, tableMode: u, runToken: d, height: f, minHeight: p, className: m, style: h, onChange: g, onError: _ }) => {
311
- let v = o(null), y = o(null), b = o(null), x = o({});
312
- x.current = {
313
- onChange: g,
314
- onError: _
316
+ function xe(t) {
317
+ let n = ({ code: n, value: a, disabled: c, readOnly: l, formData: u, env: d, runToken: f, height: p, minHeight: m, className: h, style: g, onChange: _, onError: v }) => {
318
+ let y = s(null), b = s(null), x = s(null), S = s({});
319
+ S.current = {
320
+ onChange: _,
321
+ onError: v
315
322
  };
316
- let S = o(null);
317
- S.current === null && (S.current = le(t));
318
- let C = S.current, w = L(n), T = o({
323
+ let C = s(null);
324
+ C.current === null && (C.current = ue(t));
325
+ let w = C.current, T = I(n), E = s({
319
326
  source: void 0,
320
327
  token: void 0,
321
- result: ve
328
+ result: be
322
329
  });
323
- if (T.current.source !== n || T.current.token !== d) {
330
+ if (E.current.source !== n || E.current.token !== f) {
324
331
  let e;
325
- if (!w.ok) e = {
332
+ if (!T.ok) e = {
326
333
  ok: !1,
327
- error: w.error,
334
+ error: T.error,
328
335
  Component: null
329
336
  };
330
337
  else try {
331
338
  e = {
332
339
  ok: !0,
333
340
  error: null,
334
- Component: ue(w.code, C)
341
+ Component: de(T.code, w)
335
342
  };
336
343
  } catch (t) {
337
344
  e = {
@@ -340,83 +347,83 @@ function ye(t) {
340
347
  Component: null
341
348
  };
342
349
  }
343
- T.current = {
350
+ E.current = {
344
351
  source: n,
345
- token: d,
352
+ token: f,
346
353
  result: e
347
354
  };
348
355
  }
349
- let E = T.current.result, D = r((e) => x.current.onChange?.(e), []), O = r((e) => x.current.onError?.(e), []), k = r(() => {
350
- if (y.current) return y.current;
351
- let e = v.current;
356
+ let D = E.current.result, O = r((e) => S.current.onChange?.(e), []), k = r((e) => S.current.onError?.(e), []), A = r(() => {
357
+ if (b.current) return b.current;
358
+ let e = y.current;
352
359
  if (!e) return null;
353
360
  let t = e.shadowRoot || e.attachShadow({ mode: "open" }), n = document.createElement("style"), r = document.createElement("div");
354
- return r.setAttribute("data-ai-runtime-mount", ""), r.style.height = "100%", t.append(n, r), y.current = {
355
- root: te(r, { onUncaughtError: (e) => x.current.onError?.(G(e, U.RUNTIME)) }),
361
+ return r.setAttribute("data-ai-runtime-mount", ""), r.style.height = "100%", t.append(n, r), b.current = {
362
+ root: ee(r, { onUncaughtError: (e) => S.current.onError?.(W(e, H.RUNTIME)) }),
356
363
  styleEl: n,
357
364
  mountEl: r
358
- }, y.current;
359
- }, []), A = ee(() => Q({
365
+ }, b.current;
366
+ }, []), j = o(() => Q({
360
367
  value: a,
361
- disabled: s,
362
- readOnly: c,
363
- formData: l,
364
- tableMode: u
365
- }, D), [
368
+ disabled: c,
369
+ readOnly: l,
370
+ formData: u,
371
+ env: d
372
+ }, O), [
366
373
  a,
367
- s,
368
374
  c,
369
375
  l,
370
376
  u,
371
- D
377
+ d,
378
+ O
372
379
  ]);
373
- ge(() => {
374
- let t = k();
380
+ _e(() => {
381
+ let t = A();
375
382
  if (!t) return;
376
383
  let { root: n, styleEl: r } = t;
377
- if (!E.ok) {
378
- if (b.current !== E && (b.current = E, r.textContent = "", n.render(null), E.error)) {
379
- let e = w.ok ? U.EXECUTE : U.COMPILE;
380
- x.current.onError?.(G(E.error, e));
384
+ if (!D.ok) {
385
+ if (x.current !== D && (x.current = D, r.textContent = "", n.render(null), D.error)) {
386
+ let e = T.ok ? H.EXECUTE : H.COMPILE;
387
+ S.current.onError?.(W(D.error, e));
381
388
  }
382
389
  return;
383
390
  }
384
- b.current = null;
385
- let i = Z(w.css);
391
+ x.current = null;
392
+ let i = X(T.css);
386
393
  r.textContent !== i && (r.textContent = i);
387
- let a = E.Component;
388
- n.render(/* @__PURE__ */ e(_e, {
389
- onError: O,
390
- children: /* @__PURE__ */ e(a, { ...A })
394
+ let a = D.Component;
395
+ n.render(/* @__PURE__ */ e(ve, {
396
+ onError: k,
397
+ children: /* @__PURE__ */ e(a, { ...j })
391
398
  }));
392
399
  }, [
393
- w,
394
- E,
395
- A,
396
- O,
397
- k
400
+ T,
401
+ D,
402
+ j,
403
+ k,
404
+ A
398
405
  ]), i(() => () => {
399
- let e = y.current;
400
- y.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
401
- }, []), i(() => (pe(C, (e) => x.current.onError?.(e)), () => me(C)), [C]);
402
- let j = {
403
- height: f ?? "auto",
404
- minHeight: p ?? 32,
406
+ let e = b.current;
407
+ b.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
408
+ }, []), i(() => (me(w, (e) => S.current.onError?.(e)), () => he(w)), [w]);
409
+ let M = {
410
+ height: p ?? "auto",
411
+ minHeight: m ?? 32,
405
412
  overflow: "auto",
406
413
  contain: "layout paint",
407
- ...h
414
+ ...g
408
415
  };
409
416
  return /* @__PURE__ */ e("div", {
410
- ref: v,
417
+ ref: y,
411
418
  "data-ai-runtime-host": "",
412
- className: m,
413
- style: j
419
+ className: h,
420
+ style: M
414
421
  });
415
422
  };
416
423
  return n.displayName = "BsyAiRuntimeContainer", n;
417
424
  }
418
425
  //#endregion
419
426
  //#region src/components/AiRuntimeContainer/index.ts
420
- var $ = ye("ui-base");
427
+ var $ = xe("ui-base");
421
428
  //#endregion
422
- export { $ as AiRuntimeContainer, $ as default, U as ERROR_CODE, V as MODULE_NAMES, k as assertFieldSource, se as clearCompileCache, P as compileAiCode, L as compileCached, Z as scopeCss, N as splitAiCode, Q as toPlainProps, O as validateFieldSource };
429
+ export { $ as AiRuntimeContainer, $ as default, H as ERROR_CODE, B as MODULE_NAMES, A as assertFieldSource, ce as clearCompileCache, P as compileAiCode, I as compileCached, X as scopeCss, N as splitAiCode, Q as toPlainProps, k as validateFieldSource };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import "../vendors/ConfigProvider-BDmu_0qa.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -3,7 +3,7 @@ import { t } from "../vendors/useLocale-3oUjPb-k.js";
3
3
  import { t as n } from "../vendors/cssVars-UpriQzph.js";
4
4
  import { t as r } from "../Segmented/Segmented-BMwjhsZw.js";
5
5
  import { t as i } from "../Tooltip/Tooltip-N06Os8rG.js";
6
- import { t as a } from "../DatePicker/DatePicker-DeTo-7cE.js";
6
+ import { t as a } from "../DatePicker/DatePicker-BrdDBHRB.js";
7
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
8
  import { memo as c, useCallback as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
9
9
  import h from "clsx";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../vendors/LocaleContext-CsTLO_Y2.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -7,7 +7,7 @@ import "../vendors/useLocale-3oUjPb-k.js";
7
7
  import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
8
8
  import "../Segmented/Segmented-BMwjhsZw.js";
9
9
  import "../Tooltip/Tooltip-N06Os8rG.js";
10
- import { n as e, r as t, t as n } from "./Calendar-_-doXfR6.js";
11
- import "../DatePicker/DatePicker-DeTo-7cE.js";
10
+ import { n as e, r as t, t as n } from "./Calendar-CVRev8gA.js";
11
+ import "../DatePicker/DatePicker-BrdDBHRB.js";
12
12
  import "../DatePicker/pickerLocale-Brf7_Tnd.js";
13
13
  export { n as Calendar, n as default, t as resolveCalendarThemeVars, e as resolvePlatformCalendarTheme };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import { t as e } from "./Card-BT2LRubP.js";
4
4
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "./CheckBox-DOdRLFKI.js";
4
4
  import { t as e } from "./CheckBox-CtOSHKM0.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../vendors/LocaleContext-CsTLO_Y2.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import { n as e, t } from "../vendors/ConfigProvider-BDmu_0qa.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -48,7 +48,7 @@ var w = {
48
48
  "bsy-date-picker__content": "_bsy-date-picker__content_1i2le_33",
49
49
  "bsy-date-picker__divider": "_bsy-date-picker__divider_1i2le_43",
50
50
  "bsy-date-picker__panel-loading": "_bsy-date-picker__panel-loading_1i2le_49"
51
- }, j = m(() => import("./DatePickerPanel-Ce9qqIsW.js")), M = (o) => {
51
+ }, j = m(() => import("./DatePickerPanel-BHEUpHma.js")), M = (o) => {
52
52
  let { children: m, picker: S = "date", theme: w, getPopupContainer: D, triggerActiveClassName: O, zIndex: M } = o, { locale: N } = r(), P = e(M), [F, I] = v(o, {
53
53
  defaultValuePropName: "defaultValue",
54
54
  valuePropName: "value",
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { t as e } from "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../vendors/LocaleContext-CsTLO_Y2.js";
4
4
  import { t } from "../vendors/useLocale-3oUjPb-k.js";
@@ -1,9 +1,9 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import "../Overlay/OverlayContext-CVSFoyqN.js";
4
4
  import "../vendors/useFloatingOverlay-B66lOL8v.js";
5
5
  import "../vendors/useLocale-3oUjPb-k.js";
6
6
  import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
7
- import { t as e } from "./DatePicker-DeTo-7cE.js";
7
+ import { t as e } from "./DatePicker-BrdDBHRB.js";
8
8
  import "./pickerLocale-Brf7_Tnd.js";
9
9
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { t as e } from "./Icon-CcKDWNGy.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import "../vendors/useLocale-3oUjPb-k.js";
4
4
  import { t as e } from "./Loading-Dm4i0lYd.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../Overlay/OverlayContext-CVSFoyqN.js";
4
4
  import { t as e } from "./Modal-DXH8hz96.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { t as e } from "./NotFoundContent-DJUQ0_2D.js";
3
3
  export { e as NotFoundContent };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { a as e, i as t, n, t as r } from "./OverlayContext-CVSFoyqN.js";
3
3
  export { r as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, t as OverlayProvider, e as useOverlayZIndex };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { t as e } from "./Radio-C0OAW-K-.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "./style-D26azwz6.js";
3
3
  import { t as e } from "./ScrollBar-IMTuAOF5.js";
4
4
  export { e as ScrollBar, e as default };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import { t as e } from "./Segmented-BMwjhsZw.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-CcKDWNGy.js";
4
4
  import "../vendors/LocaleContext-CsTLO_Y2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../vendors/LocaleContext-CsTLO_Y2.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Overlay/OverlayContext-CVSFoyqN.js";
3
3
  import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
4
4
  import { n as e, t } from "./Tooltip-N06Os8rG.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-y1_5EbED.js";
1
+ import "../vendors/version-Dz0OP6QK.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import { t as e } from "../vendors/Tree-f0FxoFIC.js";
4
4
  import "../CheckBox/CheckBox-DOdRLFKI.js";
@@ -1,8 +1,8 @@
1
1
  declare const AiRuntimeContainer: {
2
- ({ code, value, disabled, readOnly, formData, tableMode, runToken, height, minHeight, className, style, onChange, onError, }: import('../../../../shared/src/ai-runtime/index.ts').AiRuntimeContainerProps): import("react").JSX.Element;
2
+ ({ code, value, disabled, readOnly, formData, env, runToken, height, minHeight, className, style, onChange, onError, }: import('../../../../shared/src/ai-runtime/index.ts').AiRuntimeContainerProps): import("react").JSX.Element;
3
3
  displayName: string;
4
4
  };
5
5
  export { AiRuntimeContainer };
6
6
  export default AiRuntimeContainer;
7
- export type { AiCodeParts, AiRuntimeContainerError, AiRuntimeContainerErrorCode, AiRuntimeContainerProps, CompiledAiCode, CompiledCacheEntry, } from '../../../../shared/src/ai-runtime/index.ts';
7
+ export type { AiCodeParts, AiRuntimeContainerError, AiRuntimeContainerErrorCode, AiRuntimeContainerProps, FieldEnv, CompiledAiCode, CompiledCacheEntry, } from '../../../../shared/src/ai-runtime/index.ts';
8
8
  export { assertFieldSource, clearCompileCache, compileAiCode, compileCached, ERROR_CODE, MODULE_NAMES, scopeCss, splitAiCode, toPlainProps, validateFieldSource, } from '../../../../shared/src/ai-runtime/index.ts';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./vendors/version-y1_5EbED.js";
1
+ import "./vendors/version-Dz0OP6QK.js";
2
2
  import "./ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "./Icon/Icon-CcKDWNGy.js";
4
4
  import "./vendors/LocaleContext-CsTLO_Y2.js";
@@ -29,8 +29,8 @@ import { t as O } from "./DropDown/DropDown-B3VFy5GF.js";
29
29
  import { t as k } from "./Loading/Loading-Dm4i0lYd.js";
30
30
  import "./NotFoundContent/index.js";
31
31
  import { t as A } from "./InputTag/InputTag-C1WA6sDA.js";
32
- import { t as j } from "./Calendar/Calendar-_-doXfR6.js";
33
- import { t as M } from "./DatePicker/DatePicker-DeTo-7cE.js";
32
+ import { t as j } from "./Calendar/Calendar-CVRev8gA.js";
33
+ import { t as M } from "./DatePicker/DatePicker-BrdDBHRB.js";
34
34
  import "./DatePicker/pickerLocale-Brf7_Tnd.js";
35
35
  import { a as N, c as P, d as F, f as I, g as L, h as R, i as z, l as B, m as V, n as H, o as U, p as W, r as G, t as K, u as q } from "./Table/Table-B8381Lni.js";
36
36
  import { t as J } from "./FieldCard/FieldCard-CCv4nLpH.js";
@@ -1,6 +1,6 @@
1
1
  //#region src/version.ts
2
2
  if (typeof window < "u") {
3
3
  let e = window.__BSY_UI__ ??= {};
4
- e["@baishuyun/ui-base"] = "6.31.0";
4
+ e["@baishuyun/ui-base"] = "6.32.1";
5
5
  }
6
6
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-base",
3
- "version": "6.31.0",
3
+ "version": "6.32.1",
4
4
  "type": "module",
5
5
  "description": "百数云低代码平台通用组件库",
6
6
  "author": "bsy-fe team",