@baishuyun/ui-mobile 0.15.2 → 0.17.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.
- package/dist/AMap/index.js +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/AiRuntimeContainer/index.js +422 -0
- package/dist/Calendar/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Editor/index.js +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/Kanban/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Popup/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/components/AiRuntimeContainer/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/vendors/{version-C9PBAUeQ.js → version-DDY-JA2W.js} +1 -1
- package/package.json +6 -1
package/dist/AMap/index.js
CHANGED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import "../vendors/version-DDY-JA2W.js";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { Component as t, useCallback as n, useEffect as r, useLayoutEffect as i, useMemo as a, useRef as o } from "react";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
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
|
+
//#region ../shared/src/ai-runtime/moduleNames.ts
|
|
10
|
+
var f = ["react", "lucide-react"], p = new Set(f), m = f.join("、"), h = [
|
|
11
|
+
"value",
|
|
12
|
+
"onChange",
|
|
13
|
+
"disabled",
|
|
14
|
+
"readOnly",
|
|
15
|
+
"formData",
|
|
16
|
+
"tableMode"
|
|
17
|
+
], g = new Set([
|
|
18
|
+
"fetch",
|
|
19
|
+
"XMLHttpRequest",
|
|
20
|
+
"WebSocket",
|
|
21
|
+
"EventSource",
|
|
22
|
+
"eval",
|
|
23
|
+
"Function",
|
|
24
|
+
"globalThis",
|
|
25
|
+
"self",
|
|
26
|
+
"window",
|
|
27
|
+
"localStorage",
|
|
28
|
+
"sessionStorage",
|
|
29
|
+
"indexedDB"
|
|
30
|
+
]), _ = new Set([
|
|
31
|
+
"script",
|
|
32
|
+
"iframe",
|
|
33
|
+
"object",
|
|
34
|
+
"embed",
|
|
35
|
+
"link"
|
|
36
|
+
]), v = new Set([
|
|
37
|
+
"loc",
|
|
38
|
+
"start",
|
|
39
|
+
"end",
|
|
40
|
+
"extra",
|
|
41
|
+
"range",
|
|
42
|
+
"leadingComments",
|
|
43
|
+
"trailingComments",
|
|
44
|
+
"innerComments"
|
|
45
|
+
]), y = /url\(\s*['"]?\s*(?:https?:)?\/\//i, b = (e) => e?.type === "FunctionDeclaration" || e?.type === "FunctionExpression" || e?.type === "ArrowFunctionExpression";
|
|
46
|
+
function x(e, t) {
|
|
47
|
+
if (!(!e || typeof e.type != "string") && t(e) !== !1) for (let n of Object.keys(e)) {
|
|
48
|
+
if (v.has(n)) continue;
|
|
49
|
+
let r = e[n];
|
|
50
|
+
Array.isArray(r) ? r.forEach((e) => x(e, t)) : r && typeof r == "object" && x(r, t);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function S(e) {
|
|
54
|
+
let t = e.body.find((e) => e.type === "ExportDefaultDeclaration")?.declaration;
|
|
55
|
+
if (!t) return null;
|
|
56
|
+
if (b(t)) return t;
|
|
57
|
+
if (t.type !== "Identifier") return null;
|
|
58
|
+
for (let n of e.body) {
|
|
59
|
+
if (n.type === "FunctionDeclaration" && n.id?.name === t.name) return n;
|
|
60
|
+
if (n.type === "VariableDeclaration") {
|
|
61
|
+
let e = n.declarations.find((e) => e.id?.name === t.name && b(e.init));
|
|
62
|
+
if (e) return e.init;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
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
|
+
for (let r of e.properties) {
|
|
70
|
+
if (r.type === "RestElement") {
|
|
71
|
+
n.push(`组件不能用 ...rest 收集 props,请只解构 ${h.join("、")}。`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
let e = C(r);
|
|
75
|
+
e === null ? n.push("组件的 props 不能使用计算属性名。") : h.includes(e) || t.add(e);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function E(e) {
|
|
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" ? T(r, n, t) : r?.type === "Identifier" && x(e.body, (e) => {
|
|
81
|
+
if (e.type === "MemberExpression" && e.object?.name === r.name) {
|
|
82
|
+
let r = e.computed ? null : e.property.name;
|
|
83
|
+
return r === null ? t.push("组件不能用动态键读取 props。") : h.includes(r) || n.add(r), !1;
|
|
84
|
+
}
|
|
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
|
+
}
|
|
88
|
+
function D(e) {
|
|
89
|
+
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
90
|
+
switch (e.type) {
|
|
91
|
+
case "Identifier": return g.has(e.name) && t.add(e.name), !0;
|
|
92
|
+
case "MemberExpression":
|
|
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
|
+
case "Import":
|
|
97
|
+
case "ImportExpression": return t.add("动态 import()"), !0;
|
|
98
|
+
case "JSXOpeningElement": {
|
|
99
|
+
let n = e.name?.name;
|
|
100
|
+
return n === "textarea" ? t.add("<textarea>(单行文本的值不能包含换行)") : _.has(n) && t.add(`<${n}>`), !0;
|
|
101
|
+
}
|
|
102
|
+
case "JSXAttribute": return e.name?.name === "dangerouslySetInnerHTML" && t.add("dangerouslySetInnerHTML"), !0;
|
|
103
|
+
default: return !0;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return x(e, n), [...t];
|
|
107
|
+
}
|
|
108
|
+
function O(e) {
|
|
109
|
+
let t = [];
|
|
110
|
+
return /@import\b/i.test(e) && t.push("CSS 中不能使用 @import。"), y.test(e) && t.push("CSS 中不能引用外部地址,图片请用内联 svg 或 data: 地址。"), t;
|
|
111
|
+
}
|
|
112
|
+
function k(e, t = null) {
|
|
113
|
+
let n = [], r = null;
|
|
114
|
+
try {
|
|
115
|
+
r = c.packages.parser.parse(e, {
|
|
116
|
+
sourceType: "module",
|
|
117
|
+
plugins: ["jsx"]
|
|
118
|
+
}).program;
|
|
119
|
+
} catch (e) {
|
|
120
|
+
if (!(e instanceof SyntaxError)) throw e;
|
|
121
|
+
}
|
|
122
|
+
if (r) {
|
|
123
|
+
let e = S(r);
|
|
124
|
+
e && n.push(...E(e));
|
|
125
|
+
let t = D(r);
|
|
126
|
+
t.length && n.push(`不允许使用:${t.join("、")}。组件不能发起网络请求、使用 eval 或 Function,也不能读取 constructor 或注入脚本和原始 HTML。`);
|
|
127
|
+
}
|
|
128
|
+
return t != null && n.push(...O(t)), n;
|
|
129
|
+
}
|
|
130
|
+
function A(e, t = null) {
|
|
131
|
+
let n = k(e, t);
|
|
132
|
+
if (n.length) throw Error(`组件不符合运行时约束:\n${n.map((e) => `- ${e}`).join("\n")}`);
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region ../shared/src/ai-runtime/checkCssSyntax.ts
|
|
136
|
+
function j(e, t = "style.css") {
|
|
137
|
+
e?.trim() && u(l(e, {
|
|
138
|
+
filename: t,
|
|
139
|
+
positions: !0,
|
|
140
|
+
onParseError(e) {
|
|
141
|
+
throw Error(`/${t}: ${e.formattedMessage}`);
|
|
142
|
+
}
|
|
143
|
+
}), (e) => {
|
|
144
|
+
let n = e.value?.type === "Value" ? !e.value.children?.head : !e.value?.value?.trim();
|
|
145
|
+
if (e.type === "Declaration" && n) throw Error(`/${t}: 属性 "${e.property}" 未填写有效值 (${e.loc?.start?.line}:${e.loc?.start?.column})`);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../shared/src/ai-runtime/sourceText.ts
|
|
150
|
+
var M = /function\s+([A-Za-z_$][\w$]*)/, N = /export\s+default\b/;
|
|
151
|
+
function te(e) {
|
|
152
|
+
if (!e || N.test(e)) return e;
|
|
153
|
+
let t = e.match(M)?.[1];
|
|
154
|
+
return t ? `${e.trim()}\nexport default ${t};\n` : e;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region ../shared/src/ai-runtime/parseSourceCode.ts
|
|
158
|
+
var ne = /<(jsx|css)>([\s\S]*?)<\/\1>/g, re = {
|
|
159
|
+
ast: !1,
|
|
160
|
+
sourceType: "module",
|
|
161
|
+
presets: [["react", {
|
|
162
|
+
runtime: "classic",
|
|
163
|
+
development: !1
|
|
164
|
+
}]],
|
|
165
|
+
plugins: ["transform-modules-commonjs"]
|
|
166
|
+
};
|
|
167
|
+
function P(e) {
|
|
168
|
+
if (typeof e != "string" || !e.trim()) return null;
|
|
169
|
+
let t = null, n = null;
|
|
170
|
+
for (let r of e.matchAll(ne)) {
|
|
171
|
+
let e = r[2].trim();
|
|
172
|
+
r[1] === "jsx" && (t = e), r[1] === "css" && (n = e);
|
|
173
|
+
}
|
|
174
|
+
return t === null && n === null ? null : {
|
|
175
|
+
jsx: t,
|
|
176
|
+
css: n
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
var ie = "export default function AiRuntimeField() {\n return null;\n}";
|
|
180
|
+
function F(e, t = "ai") {
|
|
181
|
+
let n = P(e);
|
|
182
|
+
if (!n) throw Error("code 里没有可用的 <jsx> 或 <css>。");
|
|
183
|
+
let r = te(n.jsx || ie), i = n.css ?? "";
|
|
184
|
+
i && j(i, `${t}.css`), A(r, i || null);
|
|
185
|
+
let a = c.transform(r, {
|
|
186
|
+
...re,
|
|
187
|
+
filename: `${t}.jsx`
|
|
188
|
+
});
|
|
189
|
+
if (!a?.code) throw Error("Babel 没有产出可执行的代码。");
|
|
190
|
+
return {
|
|
191
|
+
code: a.code,
|
|
192
|
+
css: i
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region ../shared/src/ai-runtime/compileCache.ts
|
|
197
|
+
var ae = 200, I = /* @__PURE__ */ new Map(), oe = Object.freeze({
|
|
198
|
+
ok: !1,
|
|
199
|
+
code: "",
|
|
200
|
+
css: "",
|
|
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;
|
|
206
|
+
let r;
|
|
207
|
+
try {
|
|
208
|
+
let n = F(e, t);
|
|
209
|
+
r = {
|
|
210
|
+
ok: !0,
|
|
211
|
+
code: n.code,
|
|
212
|
+
css: n.css || "",
|
|
213
|
+
error: null
|
|
214
|
+
};
|
|
215
|
+
} catch (e) {
|
|
216
|
+
r = {
|
|
217
|
+
ok: !1,
|
|
218
|
+
code: "",
|
|
219
|
+
css: "",
|
|
220
|
+
error: e
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
if (I.size >= ae) {
|
|
224
|
+
let e = I.keys().next().value;
|
|
225
|
+
e !== void 0 && I.delete(e);
|
|
226
|
+
}
|
|
227
|
+
return I.set(e, r), r;
|
|
228
|
+
}, se = () => {
|
|
229
|
+
I.clear();
|
|
230
|
+
}, R = (e, t) => {
|
|
231
|
+
let n = {};
|
|
232
|
+
for (let t of Object.keys(e)) n[t] = e[t];
|
|
233
|
+
return (n.default === void 0 || n.default === null) && (n.default = t), Object.defineProperty(n, "__esModule", { value: !0 }), n;
|
|
234
|
+
}, z = e.default || e, ce = {
|
|
235
|
+
react: R(e, z),
|
|
236
|
+
"lucide-react": R(d, d)
|
|
237
|
+
}, B = {};
|
|
238
|
+
for (let e of f) {
|
|
239
|
+
let t = ce[e];
|
|
240
|
+
if (!t) throw Error(`模块 ${e} 在白名单里但没有实现。`);
|
|
241
|
+
B[e] = t;
|
|
242
|
+
}
|
|
243
|
+
var V = Object.keys(B), le = (e) => {
|
|
244
|
+
let t = B[e];
|
|
245
|
+
if (t) return t;
|
|
246
|
+
throw Error(`Unknown module: ${e}(组件只能 require ${V.join("、")})`);
|
|
247
|
+
}, H = {
|
|
248
|
+
COMPILE: 4001,
|
|
249
|
+
EXECUTE: 4002,
|
|
250
|
+
RENDER: 5001,
|
|
251
|
+
RUNTIME: 5002
|
|
252
|
+
}, U = new Set(Object.values(H)), W = (e, t) => {
|
|
253
|
+
let n = e instanceof Error ? e : Error(String(e)), r = n.code;
|
|
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
|
+
if (!e) throw Error("没有可执行的代码。");
|
|
257
|
+
let n = {}, r = `${e}\n//# sourceURL=${t}`;
|
|
258
|
+
if (Function("require", "exports", "React", r)(le, n, z), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
|
|
259
|
+
return n.default;
|
|
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
|
+
let t = e instanceof Error ? e.stack : void 0;
|
|
265
|
+
if (typeof t == "string") {
|
|
266
|
+
for (let [n, r] of K) if (t.includes(n)) {
|
|
267
|
+
r(W(e, H.RUNTIME));
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}, pe = () => {
|
|
272
|
+
q || typeof window > "u" || (q = !0, window.addEventListener("error", (e) => {
|
|
273
|
+
let t = e.error || Error(e.message);
|
|
274
|
+
queueMicrotask(() => Y(t));
|
|
275
|
+
}), window.addEventListener("unhandledrejection", (e) => {
|
|
276
|
+
let t = e.reason;
|
|
277
|
+
queueMicrotask(() => Y(t));
|
|
278
|
+
}));
|
|
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"), Z = typeof window > "u" ? r : i, _e = class extends t {
|
|
284
|
+
state = { failed: !1 };
|
|
285
|
+
static getDerivedStateFromError() {
|
|
286
|
+
return { failed: !0 };
|
|
287
|
+
}
|
|
288
|
+
componentDidCatch(e) {
|
|
289
|
+
fe(e), this.props.onError(W(e, H.RENDER));
|
|
290
|
+
}
|
|
291
|
+
render() {
|
|
292
|
+
return this.state.failed ? null : this.props.children;
|
|
293
|
+
}
|
|
294
|
+
}, Q = (e, t) => {
|
|
295
|
+
let n = e ?? {};
|
|
296
|
+
return {
|
|
297
|
+
value: n.value ?? "",
|
|
298
|
+
disabled: !!n.disabled,
|
|
299
|
+
readOnly: !!n.readOnly,
|
|
300
|
+
formData: n.formData || {},
|
|
301
|
+
tableMode: !!n.tableMode,
|
|
302
|
+
onChange: t
|
|
303
|
+
};
|
|
304
|
+
}, ve = {
|
|
305
|
+
ok: !1,
|
|
306
|
+
error: null,
|
|
307
|
+
Component: null
|
|
308
|
+
};
|
|
309
|
+
function ye(e) {
|
|
310
|
+
let t = ({ code: t, value: i, disabled: c, readOnly: l, formData: u, tableMode: d, runToken: f, height: p, minHeight: m, className: h, style: g, onChange: _, onError: v }) => {
|
|
311
|
+
let y = o(null), b = o(null), x = o(null), S = o({});
|
|
312
|
+
S.current = {
|
|
313
|
+
onChange: _,
|
|
314
|
+
onError: v
|
|
315
|
+
};
|
|
316
|
+
let C = o(null);
|
|
317
|
+
C.current === null && (C.current = ue(e));
|
|
318
|
+
let w = C.current, T = L(t), E = o({
|
|
319
|
+
source: void 0,
|
|
320
|
+
token: void 0,
|
|
321
|
+
result: ve
|
|
322
|
+
});
|
|
323
|
+
if (E.current.source !== t || E.current.token !== f) {
|
|
324
|
+
let e;
|
|
325
|
+
if (!T.ok) e = {
|
|
326
|
+
ok: !1,
|
|
327
|
+
error: T.error,
|
|
328
|
+
Component: null
|
|
329
|
+
};
|
|
330
|
+
else try {
|
|
331
|
+
e = {
|
|
332
|
+
ok: !0,
|
|
333
|
+
error: null,
|
|
334
|
+
Component: de(T.code, w)
|
|
335
|
+
};
|
|
336
|
+
} catch (t) {
|
|
337
|
+
e = {
|
|
338
|
+
ok: !1,
|
|
339
|
+
error: t,
|
|
340
|
+
Component: null
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
E.current = {
|
|
344
|
+
source: t,
|
|
345
|
+
token: f,
|
|
346
|
+
result: e
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
let D = E.current.result, O = n((e) => S.current.onChange?.(e), []), k = n((e) => S.current.onError?.(e), []), A = n(() => {
|
|
350
|
+
if (b.current) return b.current;
|
|
351
|
+
let e = y.current;
|
|
352
|
+
if (!e) return null;
|
|
353
|
+
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), b.current = {
|
|
355
|
+
root: ee(r, { onUncaughtError: (e) => S.current.onError?.(W(e, H.RUNTIME)) }),
|
|
356
|
+
styleEl: n,
|
|
357
|
+
mountEl: r
|
|
358
|
+
}, b.current;
|
|
359
|
+
}, []), j = a(() => Q({
|
|
360
|
+
value: i,
|
|
361
|
+
disabled: c,
|
|
362
|
+
readOnly: l,
|
|
363
|
+
formData: u,
|
|
364
|
+
tableMode: d
|
|
365
|
+
}, O), [
|
|
366
|
+
i,
|
|
367
|
+
c,
|
|
368
|
+
l,
|
|
369
|
+
u,
|
|
370
|
+
d,
|
|
371
|
+
O
|
|
372
|
+
]);
|
|
373
|
+
Z(() => {
|
|
374
|
+
let e = A();
|
|
375
|
+
if (!e) return;
|
|
376
|
+
let { root: t, styleEl: n } = e;
|
|
377
|
+
if (!D.ok) {
|
|
378
|
+
if (x.current !== D && (x.current = D, n.textContent = "", t.render(null), D.error)) {
|
|
379
|
+
let e = T.ok ? H.EXECUTE : H.COMPILE;
|
|
380
|
+
S.current.onError?.(W(D.error, e));
|
|
381
|
+
}
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
x.current = null;
|
|
385
|
+
let r = X(T.css);
|
|
386
|
+
n.textContent !== r && (n.textContent = r);
|
|
387
|
+
let i = D.Component;
|
|
388
|
+
t.render(/* @__PURE__ */ s(_e, {
|
|
389
|
+
onError: k,
|
|
390
|
+
children: /* @__PURE__ */ s(i, { ...j })
|
|
391
|
+
}));
|
|
392
|
+
}, [
|
|
393
|
+
T,
|
|
394
|
+
D,
|
|
395
|
+
j,
|
|
396
|
+
k,
|
|
397
|
+
A
|
|
398
|
+
]), r(() => () => {
|
|
399
|
+
let e = b.current;
|
|
400
|
+
b.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
|
|
401
|
+
}, []), r(() => (me(w, (e) => S.current.onError?.(e)), () => he(w)), [w]);
|
|
402
|
+
let M = {
|
|
403
|
+
height: p ?? "auto",
|
|
404
|
+
minHeight: m ?? 32,
|
|
405
|
+
overflow: "auto",
|
|
406
|
+
contain: "layout paint",
|
|
407
|
+
...g
|
|
408
|
+
};
|
|
409
|
+
return /* @__PURE__ */ s("div", {
|
|
410
|
+
ref: y,
|
|
411
|
+
"data-ai-runtime-host": "",
|
|
412
|
+
className: h,
|
|
413
|
+
style: M
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
return t.displayName = "BsyAiRuntimeContainer", t;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/components/AiRuntimeContainer/index.ts
|
|
420
|
+
var $ = ye("ui-mobile");
|
|
421
|
+
//#endregion
|
|
422
|
+
export { $ as AiRuntimeContainer, $ as default, H as ERROR_CODE, V as MODULE_NAMES, A as assertFieldSource, se as clearCompileCache, F as compileAiCode, L as compileCached, X as scopeCss, P as splitAiCode, Q as toPlainProps, k as validateFieldSource };
|
package/dist/Calendar/index.js
CHANGED
package/dist/Editor/index.js
CHANGED
package/dist/FieldCard/index.js
CHANGED
package/dist/Gantt/index.js
CHANGED
package/dist/Icon/index.js
CHANGED
package/dist/Kanban/index.js
CHANGED
package/dist/Overlay/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-DDY-JA2W.js";
|
|
2
2
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay-DFiZYsBs.js";
|
|
3
3
|
export { a as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, i as OverlayProvider, t as getNextImperativeOverlayZIndex, e as imperativeOverlayStyle, r as useOverlayZIndex };
|
package/dist/Popup/index.js
CHANGED
package/dist/Segmented/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
3
|
+
displayName: string;
|
|
4
|
+
};
|
|
5
|
+
export { AiRuntimeContainer };
|
|
6
|
+
export default AiRuntimeContainer;
|
|
7
|
+
export type { AiCodeParts, AiRuntimeContainerError, AiRuntimeContainerErrorCode, AiRuntimeContainerProps, CompiledAiCode, CompiledCacheEntry, } from '../../../../shared/src/ai-runtime/index.ts';
|
|
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-
|
|
1
|
+
import "./vendors/version-DDY-JA2W.js";
|
|
2
2
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay/Overlay-DFiZYsBs.js";
|
|
3
3
|
import { t as o } from "./ConfigProvider/useLocale-DiKogqPs.js";
|
|
4
4
|
import { t as s } from "./Popup/Popup-Cg3t422z.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-mobile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "百数云 H5 / Mobile UI 组件库",
|
|
6
6
|
"author": "bsy-fe team",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"ahooks": ">=3.7.0",
|
|
44
44
|
"dayjs": ">=1.11.0",
|
|
45
|
+
"lucide-react": ">=1.60.0",
|
|
45
46
|
"react": ">=18.3.0",
|
|
46
47
|
"react-dom": ">=18.3.0"
|
|
47
48
|
},
|
|
@@ -61,10 +62,13 @@
|
|
|
61
62
|
"@shikijs/langs": "^4.0.2",
|
|
62
63
|
"@shikijs/themes": "^4.0.2",
|
|
63
64
|
"@tanstack/react-virtual": "^3.14.3",
|
|
65
|
+
"@babel/standalone": "7.29.7",
|
|
66
|
+
"css-tree": "^3.2.1",
|
|
64
67
|
"dompurify": "^3.4.14",
|
|
65
68
|
"lexical": "0.45.0"
|
|
66
69
|
},
|
|
67
70
|
"devDependencies": {
|
|
71
|
+
"@types/babel__standalone": "^7.1.9",
|
|
68
72
|
"@types/node": "^24.3.0",
|
|
69
73
|
"@types/react": "^18.3.1",
|
|
70
74
|
"@types/react-dom": "^18.3.0",
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
"ahooks": "^3.8.5",
|
|
73
77
|
"dayjs": "^1.11.13",
|
|
74
78
|
"glob": "^11.0.3",
|
|
79
|
+
"lucide-react": "1.60.0",
|
|
75
80
|
"react": "^18.3.1",
|
|
76
81
|
"react-dom": "^18.3.1",
|
|
77
82
|
"sass": "^1.89.2",
|