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