@baishuyun/ui-base 6.34.0 → 6.36.0

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,26 +1,28 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import { jsx as e } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
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 s } 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";
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";
9
9
  //#region ../shared/src/ai-runtime/moduleNames.ts
10
- var f = ["react", "lucide-react"], p = new Set(f), m = f.join("、"), h = [
10
+ var d = ["react", "lucide-react"], f = new Set(d), p = d.join("、"), m = [
11
11
  "value",
12
12
  "onChange",
13
+ "onClick",
13
14
  "disabled",
14
15
  "readOnly",
15
16
  "formData",
16
- "env"
17
- ], g = new Set([
17
+ "env",
18
+ "widget"
19
+ ], h = new Set([
18
20
  "script",
19
21
  "iframe",
20
22
  "object",
21
23
  "embed",
22
24
  "link"
23
- ]), _ = new Set([
25
+ ]), g = new Set([
24
26
  "loc",
25
27
  "start",
26
28
  "end",
@@ -29,73 +31,73 @@ var f = ["react", "lucide-react"], p = new Set(f), m = f.join("、"), h = [
29
31
  "leadingComments",
30
32
  "trailingComments",
31
33
  "innerComments"
32
- ]), v = /url\(\s*['"]?\s*(?:https?:)?\/\//i, y = (e) => e?.type === "FunctionDeclaration" || e?.type === "FunctionExpression" || e?.type === "ArrowFunctionExpression";
33
- function b(e, t) {
34
+ ]), _ = /url\(\s*['"]?\s*(?:https?:)?\/\//i, v = (e) => e?.type === "FunctionDeclaration" || e?.type === "FunctionExpression" || e?.type === "ArrowFunctionExpression";
35
+ function y(e, t) {
34
36
  if (!(!e || typeof e.type != "string") && t(e) !== !1) for (let n of Object.keys(e)) {
35
- if (_.has(n)) continue;
37
+ if (g.has(n)) continue;
36
38
  let r = e[n];
37
- Array.isArray(r) ? r.forEach((e) => b(e, t)) : r && typeof r == "object" && b(r, t);
39
+ Array.isArray(r) ? r.forEach((e) => y(e, t)) : r && typeof r == "object" && y(r, t);
38
40
  }
39
41
  }
40
- function x(e) {
42
+ function b(e) {
41
43
  let t = e.body.find((e) => e.type === "ExportDefaultDeclaration")?.declaration;
42
44
  if (!t) return null;
43
- if (y(t)) return t;
45
+ if (v(t)) return t;
44
46
  if (t.type !== "Identifier") return null;
45
47
  for (let n of e.body) {
46
48
  if (n.type === "FunctionDeclaration" && n.id?.name === t.name) return n;
47
49
  if (n.type === "VariableDeclaration") {
48
- let e = n.declarations.find((e) => e.id?.name === t.name && y(e.init));
50
+ let e = n.declarations.find((e) => e.id?.name === t.name && v(e.init));
49
51
  if (e) return e.init;
50
52
  }
51
53
  }
52
54
  return null;
53
55
  }
54
- var S = (e) => e.computed ? null : e.key.type === "Identifier" ? e.key.name : e.key.type === "StringLiteral" ? e.key.value : null;
55
- function C(e, t, n) {
56
+ var x = (e) => e.computed ? null : e.key.type === "Identifier" ? e.key.name : e.key.type === "StringLiteral" ? e.key.value : null;
57
+ function S(e, t, n) {
56
58
  for (let r of e.properties) {
57
59
  if (r.type === "RestElement") {
58
- n.push(`组件不能用 ...rest 收集 props,请只解构 ${h.join("、")}。`);
60
+ n.push(`组件不能用 ...rest 收集 props,请只解构 ${m.join("、")}。`);
59
61
  continue;
60
62
  }
61
- let e = S(r);
62
- e === null ? n.push("组件的 props 不能使用计算属性名。") : h.includes(e) || t.add(e);
63
+ let e = x(r);
64
+ e === null ? n.push("组件的 props 不能使用计算属性名。") : m.includes(e) || t.add(e);
63
65
  }
64
66
  }
65
- function w(e) {
67
+ function C(e) {
66
68
  let t = [], n = /* @__PURE__ */ new Set(), [r] = e.params;
67
- return e.params.length > 1 && t.push("组件只接收一个 props 参数,不能有第二个参数(如 ref)。"), r?.type === "AssignmentPattern" && (r = r.left), r?.type === "ObjectPattern" ? C(r, n, t) : r?.type === "Identifier" && b(e.body, (e) => {
69
+ return e.params.length > 1 && t.push("组件只接收一个 props 参数,不能有第二个参数(如 ref)。"), r?.type === "AssignmentPattern" && (r = r.left), r?.type === "ObjectPattern" ? S(r, n, t) : r?.type === "Identifier" && y(e.body, (e) => {
68
70
  if (e.type === "MemberExpression" && e.object?.name === r.name) {
69
71
  let r = e.computed ? null : e.property.name;
70
- return r === null ? t.push("组件不能用动态键读取 props。") : h.includes(r) || n.add(r), !1;
72
+ return r === null ? t.push("组件不能用动态键读取 props。") : m.includes(r) || n.add(r), !1;
71
73
  }
72
- return e.type === "VariableDeclarator" && e.init?.name === r.name && e.id.type === "ObjectPattern" ? (C(e.id, n, t), !1) : !0;
73
- }), n.size && t.unshift(`组件签名只能接收 ${h.join("、")},发现多余的 props:${[...n].join("、")}。平台不会传入它们,请删除,需要的文案或配置直接写在组件内部。`), t;
74
+ return e.type === "VariableDeclarator" && e.init?.name === r.name && e.id.type === "ObjectPattern" ? (S(e.id, n, t), !1) : !0;
75
+ }), n.size && t.unshift(`组件签名只能接收 ${m.join("、")},发现多余的 props:${[...n].join("、")}。平台不会传入它们,请删除。`), t;
74
76
  }
75
- function T(e) {
77
+ function w(e) {
76
78
  let t = /* @__PURE__ */ new Set();
77
- return b(e, (e) => {
79
+ return y(e, (e) => {
78
80
  switch (e.type) {
79
- case "ImportDeclaration": return p.has(e.source.value) || t.add(`import "${e.source.value}"(只能 import ${m})`), !1;
81
+ case "ImportDeclaration": return f.has(e.source.value) || t.add(`import "${e.source.value}"(只能 import ${p})`), !1;
80
82
  case "Import":
81
83
  case "ImportExpression": return t.add("动态 import()"), !0;
82
84
  case "JSXOpeningElement": {
83
85
  let n = e.name?.name;
84
- return g.has(n) && t.add(`<${n}>`), !0;
86
+ return h.has(n) && t.add(`<${n}>`), !0;
85
87
  }
86
88
  case "JSXAttribute": return e.name?.name === "dangerouslySetInnerHTML" && t.add("dangerouslySetInnerHTML"), !0;
87
89
  default: return !0;
88
90
  }
89
91
  }), [...t];
90
92
  }
91
- function E(e) {
93
+ function T(e) {
92
94
  let t = [];
93
- return /@import\b/i.test(e) && t.push("CSS 中不能使用 @import。"), v.test(e) && t.push("CSS 中不能引用外部地址,图片请用内联 svg 或 data: 地址。"), t;
95
+ return /@import\b/i.test(e) && t.push("CSS 中不能使用 @import。"), _.test(e) && t.push("CSS 中不能引用外部地址,图片请用内联 svg 或 data: 地址。"), t;
94
96
  }
95
- function D(e, t = null) {
97
+ function E(e, t = null) {
96
98
  let n = [], r = null;
97
99
  try {
98
- r = c.packages.parser.parse(e, {
100
+ r = s.packages.parser.parse(e, {
99
101
  sourceType: "module",
100
102
  plugins: ["jsx"]
101
103
  }).program;
@@ -103,21 +105,21 @@ function D(e, t = null) {
103
105
  if (!(e instanceof SyntaxError)) throw e;
104
106
  }
105
107
  if (r) {
106
- let e = x(r);
107
- e && n.push(...w(e));
108
- let t = T(r);
108
+ let e = b(r);
109
+ e && n.push(...C(e));
110
+ let t = w(r);
109
111
  t.length && n.push(`不允许使用:${t.join("、")}。组件只能 import 宿主注册过的模块,也不能注入脚本和原始 HTML。`);
110
112
  }
111
- return t != null && n.push(...E(t)), n;
113
+ return t != null && n.push(...T(t)), n;
112
114
  }
113
- function O(e, t = null) {
114
- let n = D(e, t);
115
+ function D(e, t = null) {
116
+ let n = E(e, t);
115
117
  if (n.length) throw Error(`组件不符合运行时约束:\n${n.map((e) => `- ${e}`).join("\n")}`);
116
118
  }
117
119
  //#endregion
118
120
  //#region ../shared/src/ai-runtime/checkCssSyntax.ts
119
- function k(e, t = "style.css") {
120
- e?.trim() && u(l(e, {
121
+ function O(e, t = "style.css") {
122
+ e?.trim() && l(c(e, {
121
123
  filename: t,
122
124
  positions: !0,
123
125
  onParseError(e) {
@@ -130,15 +132,15 @@ function k(e, t = "style.css") {
130
132
  }
131
133
  //#endregion
132
134
  //#region ../shared/src/ai-runtime/sourceText.ts
133
- var A = /function\s+([A-Za-z_$][\w$]*)/, j = /export\s+default\b/;
134
- function M(e) {
135
- if (!e || j.test(e)) return e;
136
- let t = e.match(A)?.[1];
135
+ var k = /function\s+([A-Za-z_$][\w$]*)/, A = /export\s+default\b/;
136
+ function j(e) {
137
+ if (!e || A.test(e)) return e;
138
+ let t = e.match(k)?.[1];
137
139
  return t ? `${e.trim()}\nexport default ${t};\n` : e;
138
140
  }
139
141
  //#endregion
140
142
  //#region ../shared/src/ai-runtime/parseSourceCode.ts
141
- var N = /<(jsx|css)>([\s\S]*?)<\/\1>/g, te = {
143
+ var M = /<(jsx|css)>([\s\S]*?)<\/\1>/g, N = {
142
144
  ast: !1,
143
145
  sourceType: "module",
144
146
  presets: [["react", {
@@ -150,7 +152,7 @@ var N = /<(jsx|css)>([\s\S]*?)<\/\1>/g, te = {
150
152
  function P(e) {
151
153
  if (typeof e != "string" || !e.trim()) return null;
152
154
  let t = null, n = null;
153
- for (let r of e.matchAll(N)) {
155
+ for (let r of e.matchAll(M)) {
154
156
  let e = r[2].trim();
155
157
  r[1] === "jsx" && (t = e), r[1] === "css" && (n = e);
156
158
  }
@@ -159,14 +161,14 @@ function P(e) {
159
161
  css: n
160
162
  };
161
163
  }
162
- var ne = "export default function AiRuntimeField() {\n return null;\n}";
163
- function F(e, t = "ai") {
164
+ var F = "export default function AiRuntimeField() {\n return null;\n}";
165
+ function I(e, t = "ai") {
164
166
  let n = P(e);
165
167
  if (!n) throw Error("code 里没有可用的 <jsx> 或 <css>。");
166
- let r = M(n.jsx || ne), i = n.css ?? "";
167
- i && k(i, `${t}.css`), O(r, i || null);
168
- let a = c.transform(r, {
169
- ...te,
168
+ let r = j(n.jsx || F), i = n.css ?? "";
169
+ i && O(i, `${t}.css`), D(r, i || null);
170
+ let a = s.transform(r, {
171
+ ...N,
170
172
  filename: `${t}.jsx`
171
173
  });
172
174
  if (!a?.code) throw Error("Babel 没有产出可执行的代码。");
@@ -177,18 +179,18 @@ function F(e, t = "ai") {
177
179
  }
178
180
  //#endregion
179
181
  //#region ../shared/src/ai-runtime/compileCache.ts
180
- var re = 200, I = /* @__PURE__ */ new Map(), ie = Object.freeze({
182
+ var ne = 200, L = /* @__PURE__ */ new Map(), R = Object.freeze({
181
183
  ok: !1,
182
184
  code: "",
183
185
  css: "",
184
186
  error: null
185
- }), L = (e, t) => {
186
- if (typeof e != "string" || !e.trim()) return ie;
187
- let n = I.get(e);
188
- if (n) return I.delete(e), I.set(e, n), n;
187
+ }), z = (e, t) => {
188
+ if (typeof e != "string" || !e.trim()) return R;
189
+ let n = L.get(e);
190
+ if (n) return L.delete(e), L.set(e, n), n;
189
191
  let r;
190
192
  try {
191
- let n = F(e, t);
193
+ let n = I(e, t);
192
194
  r = {
193
195
  ok: !0,
194
196
  code: n.code,
@@ -203,73 +205,73 @@ var re = 200, I = /* @__PURE__ */ new Map(), ie = Object.freeze({
203
205
  error: e
204
206
  };
205
207
  }
206
- if (I.size >= re) {
207
- let e = I.keys().next().value;
208
- e !== void 0 && I.delete(e);
208
+ if (L.size >= ne) {
209
+ let e = L.keys().next().value;
210
+ e !== void 0 && L.delete(e);
209
211
  }
210
- return I.set(e, r), r;
211
- }, ae = () => {
212
- I.clear();
213
- }, R = (e, t) => {
212
+ return L.set(e, r), r;
213
+ }, re = () => {
214
+ L.clear();
215
+ }, B = (e, t) => {
214
216
  let n = {};
215
217
  for (let t of Object.keys(e)) n[t] = e[t];
216
218
  return (n.default === void 0 || n.default === null) && (n.default = t), Object.defineProperty(n, "__esModule", { value: !0 }), n;
217
- }, z = t.default || t, oe = {
218
- react: R(t, z),
219
- "lucide-react": R(d, d)
220
- }, B = {};
221
- for (let e of f) {
222
- let t = oe[e];
219
+ }, V = t.default || t, ie = {
220
+ react: B(t, V),
221
+ "lucide-react": B(u, u)
222
+ }, H = {};
223
+ for (let e of d) {
224
+ let t = ie[e];
223
225
  if (!t) throw Error(`模块 ${e} 在白名单里但没有实现。`);
224
- B[e] = t;
226
+ H[e] = t;
225
227
  }
226
- var V = Object.keys(B), se = (e) => {
227
- let t = B[e];
228
+ var U = Object.keys(H), ae = (e) => {
229
+ let t = H[e];
228
230
  if (t) return t;
229
- throw Error(`Unknown module: ${e}(组件只能 require ${V.join("、")})`);
230
- }, H = {
231
+ throw Error(`Unknown module: ${e}(组件只能 require ${U.join("、")})`);
232
+ }, W = {
231
233
  COMPILE: 4001,
232
234
  EXECUTE: 4002,
233
235
  RENDER: 5001,
234
236
  RUNTIME: 5002
235
- }, U = new Set(Object.values(H)), W = (e, t) => {
237
+ }, oe = new Set(Object.values(W)), G = (e, t) => {
236
238
  let n = e instanceof Error ? e : Error(String(e)), r = n.code;
237
- return (typeof r != "number" || !U.has(r)) && (n.code = t), n;
238
- }, G = 0, ce = (e) => (G += 1, `ai-runtime-${e}-${G}.js`), le = (e, t) => {
239
+ return (typeof r != "number" || !oe.has(r)) && (n.code = t), n;
240
+ }, K = 0, se = (e) => (K += 1, `ai-runtime-${e}-${K}.js`), ce = (e, t) => {
239
241
  if (!e) throw Error("没有可执行的代码。");
240
242
  let n = {}, r = `${e}\n//# sourceURL=${t}`;
241
- if (Function("require", "exports", "React", r)(se, n, z), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
243
+ if (Function("require", "exports", "React", r)(ae, n, V), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
242
244
  return n.default;
243
- }, K = /* @__PURE__ */ new Map(), q = !1, J = /* @__PURE__ */ new WeakSet(), ue = (e) => {
244
- e && typeof e == "object" && J.add(e);
245
- }, Y = (e) => {
246
- if (e && typeof e == "object" && J.has(e)) return;
245
+ }, q = /* @__PURE__ */ new Map(), J = !1, Y = /* @__PURE__ */ new WeakSet(), le = (e) => {
246
+ e && typeof e == "object" && Y.add(e);
247
+ }, X = (e) => {
248
+ if (e && typeof e == "object" && Y.has(e)) return;
247
249
  let t = e instanceof Error ? e.stack : void 0;
248
250
  if (typeof t == "string") {
249
- for (let [n, r] of K) if (t.includes(n)) {
250
- r(W(e, H.RUNTIME));
251
+ for (let [n, r] of q) if (t.includes(n)) {
252
+ r(G(e, W.RUNTIME));
251
253
  return;
252
254
  }
253
255
  }
254
- }, de = () => {
255
- q || typeof window > "u" || (q = !0, window.addEventListener("error", (e) => {
256
+ }, ue = () => {
257
+ J || typeof window > "u" || (J = !0, window.addEventListener("error", (e) => {
256
258
  let t = e.error || Error(e.message);
257
- queueMicrotask(() => Y(t));
259
+ queueMicrotask(() => X(t));
258
260
  }), window.addEventListener("unhandledrejection", (e) => {
259
261
  let t = e.reason;
260
- queueMicrotask(() => Y(t));
262
+ queueMicrotask(() => X(t));
261
263
  }));
262
- }, fe = (e, t) => {
263
- de(), K.set(e, t);
264
- }, pe = (e) => {
265
- K.delete(e);
266
- }, me = /(^|[\s,>+~(])(?::root\b|html\b|body\b)/gi, X = (e) => typeof e != "string" || !e ? "" : e.replace(me, "$1:host"), he = typeof window > "u" ? i : a, Z = class extends n {
264
+ }, de = (e, t) => {
265
+ ue(), q.set(e, t);
266
+ }, fe = (e) => {
267
+ q.delete(e);
268
+ }, pe = /(^|[\s,>+~(])(?::root\b|html\b|body\b)/gi, Z = (e) => typeof e != "string" || !e ? "" : e.replace(pe, "$1:host"), me = typeof window > "u" ? i : a, he = class extends n {
267
269
  state = { failed: !1 };
268
270
  static getDerivedStateFromError() {
269
271
  return { failed: !0 };
270
272
  }
271
273
  componentDidCatch(e) {
272
- ue(e), this.props.onError(W(e, H.RENDER));
274
+ le(e), this.props.onError(G(e, W.RENDER));
273
275
  }
274
276
  render() {
275
277
  return this.state.failed ? null : this.props.children;
@@ -281,47 +283,48 @@ var V = Object.keys(B), se = (e) => {
281
283
  ]), _e = (e) => ({
282
284
  view: ge.has(e?.view) ? e?.view : "form",
283
285
  platform: e?.platform === "mobile" ? "mobile" : "pc"
284
- }), Q = (e, t) => {
285
- let n = e ?? {};
286
- return {
287
- value: n.value ?? "",
288
- disabled: !!n.disabled,
289
- readOnly: !!n.readOnly,
290
- formData: n.formData || {},
291
- env: _e(n.env),
286
+ }), Q = (e, t, n) => {
287
+ let r = e ?? {}, i = {
288
+ value: r.value ?? "",
289
+ disabled: !!r.disabled,
290
+ readOnly: !!r.readOnly,
291
+ formData: r.formData || {},
292
+ env: _e(r.env),
292
293
  onChange: t
293
294
  };
295
+ return n && (i.onClick = n), r.widget && (i.widget = r.widget), i;
294
296
  }, ve = {
295
297
  ok: !1,
296
298
  error: null,
297
299
  Component: null
298
300
  };
299
301
  function ye(t) {
300
- 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 }) => {
301
- let y = o(null), b = o(null), x = o(null), S = o({});
302
- S.current = {
302
+ let n = ({ code: n, value: a, disabled: s, readOnly: c, formData: l, env: u, widget: d, runToken: f, height: p, minHeight: m, className: h, style: g, onChange: _, onClick: v, onError: y }) => {
303
+ let b = o(null), x = o(null), S = o(null), C = o({});
304
+ C.current = {
303
305
  onChange: _,
304
- onError: v
306
+ onClick: v,
307
+ onError: y
305
308
  };
306
- let C = o(null);
307
- C.current === null && (C.current = ce(t));
308
- let w = C.current, T = L(n), E = o({
309
+ let w = o(null);
310
+ w.current === null && (w.current = se(t));
311
+ let T = w.current, E = z(n), D = o({
309
312
  source: void 0,
310
313
  token: void 0,
311
314
  result: ve
312
315
  });
313
- if (E.current.source !== n || E.current.token !== f) {
316
+ if (D.current.source !== n || D.current.token !== f) {
314
317
  let e;
315
- if (!T.ok) e = {
318
+ if (!E.ok) e = {
316
319
  ok: !1,
317
- error: T.error,
320
+ error: E.error,
318
321
  Component: null
319
322
  };
320
323
  else try {
321
324
  e = {
322
325
  ok: !0,
323
326
  error: null,
324
- Component: le(T.code, w)
327
+ Component: ce(E.code, T)
325
328
  };
326
329
  } catch (t) {
327
330
  e = {
@@ -330,76 +333,80 @@ function ye(t) {
330
333
  Component: null
331
334
  };
332
335
  }
333
- E.current = {
336
+ D.current = {
334
337
  source: n,
335
338
  token: f,
336
339
  result: e
337
340
  };
338
341
  }
339
- let D = E.current.result, O = r((e) => S.current.onChange?.(e), []), k = r((e) => S.current.onError?.(e), []), A = r(() => {
340
- if (b.current) return b.current;
341
- let e = y.current;
342
+ let O = D.current.result, k = r((e) => C.current.onChange?.(e), []), A = r(() => C.current.onClick?.(), []), j = typeof v == "function", M = r((e) => C.current.onError?.(e), []), N = r(() => {
343
+ if (x.current) return x.current;
344
+ let e = b.current;
342
345
  if (!e) return null;
343
346
  let t = e.shadowRoot || e.attachShadow({ mode: "open" }), n = document.createElement("style"), r = document.createElement("div");
344
- return r.setAttribute("data-ai-runtime-mount", ""), r.style.height = "100%", t.append(n, r), b.current = {
345
- root: s(r, { onUncaughtError: (e) => S.current.onError?.(W(e, H.RUNTIME)) }),
347
+ return r.setAttribute("data-ai-runtime-mount", ""), r.style.height = "100%", t.append(n, r), x.current = {
348
+ root: te(r, { onUncaughtError: (e) => C.current.onError?.(G(e, W.RUNTIME)) }),
346
349
  styleEl: n,
347
350
  mountEl: r
348
- }, b.current;
349
- }, []), j = ee(() => Q({
351
+ }, x.current;
352
+ }, []), P = ee(() => Q({
350
353
  value: a,
351
- disabled: c,
352
- readOnly: l,
353
- formData: u,
354
- env: d
355
- }, O), [
354
+ disabled: s,
355
+ readOnly: c,
356
+ formData: l,
357
+ env: u,
358
+ widget: d
359
+ }, k, j ? A : void 0), [
356
360
  a,
361
+ s,
357
362
  c,
358
363
  l,
359
364
  u,
360
365
  d,
361
- O
366
+ k,
367
+ j,
368
+ A
362
369
  ]);
363
- he(() => {
364
- let t = A();
370
+ me(() => {
371
+ let t = N();
365
372
  if (!t) return;
366
373
  let { root: n, styleEl: r } = t;
367
- if (!D.ok) {
368
- if (x.current !== D && (x.current = D, r.textContent = "", n.render(null), D.error)) {
369
- let e = T.ok ? H.EXECUTE : H.COMPILE;
370
- S.current.onError?.(W(D.error, e));
374
+ if (!O.ok) {
375
+ if (S.current !== O && (S.current = O, r.textContent = "", n.render(null), O.error)) {
376
+ let e = E.ok ? W.EXECUTE : W.COMPILE;
377
+ C.current.onError?.(G(O.error, e));
371
378
  }
372
379
  return;
373
380
  }
374
- x.current = null;
375
- let i = X(T.css);
381
+ S.current = null;
382
+ let i = Z(E.css);
376
383
  r.textContent !== i && (r.textContent = i);
377
- let a = D.Component;
378
- n.render(/* @__PURE__ */ e(Z, {
379
- onError: k,
380
- children: /* @__PURE__ */ e(a, { ...j })
384
+ let a = O.Component;
385
+ n.render(/* @__PURE__ */ e(he, {
386
+ onError: M,
387
+ children: /* @__PURE__ */ e(a, { ...P })
381
388
  }));
382
389
  }, [
383
- T,
384
- D,
385
- j,
386
- k,
387
- A
390
+ E,
391
+ O,
392
+ P,
393
+ M,
394
+ N
388
395
  ]), i(() => () => {
389
- let e = b.current;
390
- b.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
391
- }, []), i(() => (fe(w, (e) => S.current.onError?.(e)), () => pe(w)), [w]);
392
- let M = {
396
+ let e = x.current;
397
+ x.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
398
+ }, []), i(() => (de(T, (e) => C.current.onError?.(e)), () => fe(T)), [T]);
399
+ let F = {
393
400
  height: p ?? "auto",
394
401
  minHeight: m ?? 32,
395
402
  contain: "layout paint",
396
403
  ...g
397
404
  };
398
405
  return /* @__PURE__ */ e("div", {
399
- ref: y,
406
+ ref: b,
400
407
  "data-ai-runtime-host": "",
401
408
  className: h,
402
- style: M
409
+ style: F
403
410
  });
404
411
  };
405
412
  return n.displayName = "BsyAiRuntimeContainer", n;
@@ -408,4 +415,4 @@ function ye(t) {
408
415
  //#region src/components/AiRuntimeContainer/index.ts
409
416
  var $ = ye("ui-base");
410
417
  //#endregion
411
- export { $ as AiRuntimeContainer, $ as default, H as ERROR_CODE, V as MODULE_NAMES, O as assertFieldSource, ae as clearCompileCache, F as compileAiCode, L as compileCached, X as scopeCss, P as splitAiCode, Q as toPlainProps, D as validateFieldSource };
418
+ export { $ as AiRuntimeContainer, $ as default, W as ERROR_CODE, U as MODULE_NAMES, D as assertFieldSource, re as clearCompileCache, I as compileAiCode, z as compileCached, Z as scopeCss, P as splitAiCode, Q as toPlainProps, E as validateFieldSource };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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/cssVars-BbL_cmFM.js";
3
3
  import { t as n } from "../vendors/useLocale-DvhRopWF.js";
4
4
  import { t as r } from "../Segmented/Segmented-AHLqTK7U.js";
5
5
  import { t as i } from "../Tooltip/Tooltip-N-w19uRu.js";
6
- import { t as a } from "../DatePicker/DatePicker-DwlDV-_e.js";
6
+ import { t as a } from "../DatePicker/DatePicker-B2j3wS1Q.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-DvhRopWF.js";
7
7
  import "../vendors/useLatchedPopupPortalRoot-Cu3oUL9h.js";
8
8
  import "../Segmented/Segmented-AHLqTK7U.js";
9
9
  import "../Tooltip/Tooltip-N-w19uRu.js";
10
- import { n as e, r as t, t as n } from "./Calendar-Cx-sUiyk.js";
11
- import "../DatePicker/DatePicker-DwlDV-_e.js";
10
+ import { n as e, r as t, t as n } from "./Calendar-Dc-vtEUE.js";
11
+ import "../DatePicker/DatePicker-B2j3wS1Q.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import { t as e } from "./Card-Cdb5cVMG.js";
4
4
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "./CheckBox-BXKoPSBh.js";
4
4
  import { t as e } from "./CheckBox-DihUnPT-.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Ca8f-74-.js")), M = (n) => {
51
+ }, j = m(() => import("./DatePickerPanel-9QMZVURh.js")), M = (n) => {
52
52
  let { children: m, picker: S = "date", theme: w, getPopupContainer: D, triggerActiveClassName: O, zIndex: M } = n, { locale: N } = i(), P = e(M), [F, I] = v(n, {
53
53
  defaultValuePropName: "defaultValue",
54
54
  valuePropName: "value",
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-DvhRopWF.js";
@@ -1,9 +1,9 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import "../Overlay/OverlayContext-CVSFoyqN.js";
4
4
  import "../vendors/useFloatingOverlay-DlLAeqUv.js";
5
5
  import "../vendors/useLocale-DvhRopWF.js";
6
6
  import "../vendors/useLatchedPopupPortalRoot-Cu3oUL9h.js";
7
- import { t as e } from "./DatePicker-DwlDV-_e.js";
7
+ import { t as e } from "./DatePicker-B2j3wS1Q.js";
8
8
  import "./pickerLocale-Brf7_Tnd.js";
9
9
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../vendors/LocaleContext-CsTLO_Y2.js";
3
3
  import "../vendors/useLocale-DvhRopWF.js";
4
4
  import { t as e } from "./Loading-CLUJfdln.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import "../Overlay/OverlayContext-CVSFoyqN.js";
4
4
  import { t as e } from "./Modal-BeDIo3CM.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import { t as e } from "./Radio-GeMs-7qt.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "./style-D26azwz6.js";
3
3
  import { t as e } from "./ScrollBar-DJ6DaHDb.js";
4
4
  export { e as ScrollBar, e as default };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import { t as e } from "./Segmented-AHLqTK7U.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.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-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../Overlay/OverlayContext-CVSFoyqN.js";
3
3
  import "../vendors/useLatchedPopupPortalRoot-Cu3oUL9h.js";
4
4
  import { n as e, t } from "./Tooltip-N-w19uRu.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-Di95Ubpo.js";
1
+ import "../vendors/version-nMRJnzpN.js";
2
2
  import "../Icon/Icon-CcKDWNGy.js";
3
3
  import { t as e } from "../vendors/Tree-C8l3t4L6.js";
4
4
  import "../CheckBox/CheckBox-BXKoPSBh.js";
@@ -1,5 +1,5 @@
1
1
  declare const AiRuntimeContainer: {
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;
2
+ ({ code, value, disabled, readOnly, formData, env, widget, runToken, height, minHeight, className, style, onChange, onClick, onError, }: import('../../../../shared/src/ai-runtime/index.ts').AiRuntimeContainerProps): import("react").JSX.Element;
3
3
  displayName: string;
4
4
  };
5
5
  export { AiRuntimeContainer };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./vendors/version-Di95Ubpo.js";
1
+ import "./vendors/version-nMRJnzpN.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-D97QGQpV.js";
29
29
  import { t as k } from "./Loading/Loading-CLUJfdln.js";
30
30
  import "./NotFoundContent/index.js";
31
31
  import { t as A } from "./InputTag/InputTag-5NTrA5bA.js";
32
- import { t as j } from "./Calendar/Calendar-Cx-sUiyk.js";
33
- import { t as M } from "./DatePicker/DatePicker-DwlDV-_e.js";
32
+ import { t as j } from "./Calendar/Calendar-Dc-vtEUE.js";
33
+ import { t as M } from "./DatePicker/DatePicker-B2j3wS1Q.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-B7fDob3i.js";
36
36
  import { t as J } from "./FieldCard/FieldCard-CTrNTXFc.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.34.0";
4
+ e["@baishuyun/ui-base"] = "6.36.0";
5
5
  }
6
6
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-base",
3
- "version": "6.34.0",
3
+ "version": "6.36.0",
4
4
  "type": "module",
5
5
  "description": "百数云低代码平台通用组件库",
6
6
  "author": "bsy-fe team",