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