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