@baishuyun/ui-mobile 0.22.2 → 0.22.3
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 +124 -124
- 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/index.js +1 -1
- package/dist/vendors/{version-CXRtK900.js → version-Cf4pY2bq.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-Cf4pY2bq.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";
|
|
@@ -168,11 +168,11 @@ function I(e) {
|
|
|
168
168
|
css: n
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
var
|
|
172
|
-
function
|
|
171
|
+
var L = "export default function AiRuntimeField() {\n return null;\n}";
|
|
172
|
+
function R(e, t = "ai") {
|
|
173
173
|
let n = I(e);
|
|
174
174
|
if (!n) throw Error("code 里没有可用的 <jsx> 或 <css>。");
|
|
175
|
-
let r = N(n.jsx ||
|
|
175
|
+
let r = N(n.jsx || L), i = n.css ?? "";
|
|
176
176
|
i && A(i, `${t}.css`), k(r, i || null);
|
|
177
177
|
let a = l.transform(r, {
|
|
178
178
|
...F,
|
|
@@ -186,18 +186,18 @@ function ne(e, t = "ai") {
|
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region ../shared/src/ai-runtime/compileCache.ts
|
|
189
|
-
var
|
|
189
|
+
var te = 200, z = /* @__PURE__ */ new Map(), ne = Object.freeze({
|
|
190
190
|
ok: !1,
|
|
191
191
|
code: "",
|
|
192
192
|
css: "",
|
|
193
193
|
error: null
|
|
194
|
-
}),
|
|
195
|
-
if (typeof e != "string" || !e.trim()) return
|
|
196
|
-
let n = e, r =
|
|
197
|
-
if (r) return
|
|
194
|
+
}), B = (e, t) => {
|
|
195
|
+
if (typeof e != "string" || !e.trim()) return ne;
|
|
196
|
+
let n = e, r = z.get(n);
|
|
197
|
+
if (r) return z.delete(n), z.set(n, r), r;
|
|
198
198
|
let i;
|
|
199
199
|
try {
|
|
200
|
-
let n =
|
|
200
|
+
let n = R(e, t);
|
|
201
201
|
i = {
|
|
202
202
|
ok: !0,
|
|
203
203
|
code: n.code,
|
|
@@ -212,86 +212,86 @@ var re = 200, L = /* @__PURE__ */ new Map(), ie = Object.freeze({
|
|
|
212
212
|
error: e
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
if (
|
|
216
|
-
let e =
|
|
217
|
-
e !== void 0 &&
|
|
215
|
+
if (z.size >= te) {
|
|
216
|
+
let e = z.keys().next().value;
|
|
217
|
+
e !== void 0 && z.delete(e);
|
|
218
218
|
}
|
|
219
|
-
return
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
},
|
|
219
|
+
return z.set(n, i), i;
|
|
220
|
+
}, re = () => {
|
|
221
|
+
z.clear();
|
|
222
|
+
}, V = (e, t) => {
|
|
223
223
|
let n = {};
|
|
224
224
|
for (let t of Object.keys(e)) n[t] = e[t];
|
|
225
225
|
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
|
-
},
|
|
226
|
+
}, H = e.default || e, ie = s.default || s, ae = {
|
|
227
|
+
react: V(e, H),
|
|
228
|
+
"react-dom": V(s, ie),
|
|
229
|
+
"lucide-react": V(f, f)
|
|
230
|
+
}, U = {};
|
|
231
231
|
for (let e of p) {
|
|
232
|
-
let t =
|
|
232
|
+
let t = ae[e];
|
|
233
233
|
if (!t) throw Error(`模块 ${e} 在白名单里但没有实现。`);
|
|
234
|
-
|
|
234
|
+
U[e] = t;
|
|
235
235
|
}
|
|
236
|
-
var
|
|
237
|
-
let t =
|
|
236
|
+
var W = Object.keys(U), oe = (e) => {
|
|
237
|
+
let t = U[e];
|
|
238
238
|
if (t) return t;
|
|
239
|
-
throw Error(`Unknown module: ${e}(组件只能 require ${
|
|
240
|
-
},
|
|
239
|
+
throw Error(`Unknown module: ${e}(组件只能 require ${W.join("、")})`);
|
|
240
|
+
}, G = {
|
|
241
241
|
COMPILE: 4001,
|
|
242
242
|
EXECUTE: 4002,
|
|
243
243
|
RENDER: 5001,
|
|
244
244
|
RUNTIME: 5002
|
|
245
|
-
},
|
|
245
|
+
}, se = new Set(Object.values(G)), K = (e, t) => {
|
|
246
246
|
let n = e instanceof Error ? e : Error(String(e)), r = n.code;
|
|
247
|
-
return (typeof r != "number" || !
|
|
248
|
-
},
|
|
247
|
+
return (typeof r != "number" || !se.has(r)) && (n.code = t), n;
|
|
248
|
+
}, q = 0, ce = (e) => (q += 1, `ai-runtime-${e}-${q}.js`), le = (e, t) => {
|
|
249
249
|
if (!e) throw Error("没有可执行的代码。");
|
|
250
250
|
let n = {}, r = `${e}\n//# sourceURL=${t}`;
|
|
251
|
-
if (Function("require", "exports", "React", r)(
|
|
251
|
+
if (Function("require", "exports", "React", r)(oe, n, H), typeof n.default != "function") throw Error("Missing default export:组件必须默认导出一个函数。");
|
|
252
252
|
return n.default;
|
|
253
|
-
},
|
|
254
|
-
e && typeof e == "object" &&
|
|
255
|
-
},
|
|
256
|
-
if (e && typeof e == "object" &&
|
|
253
|
+
}, J = /* @__PURE__ */ new Map(), Y = !1, X = /* @__PURE__ */ new WeakSet(), ue = (e) => {
|
|
254
|
+
e && typeof e == "object" && X.add(e);
|
|
255
|
+
}, Z = (e) => {
|
|
256
|
+
if (e && typeof e == "object" && X.has(e)) return;
|
|
257
257
|
let t = e instanceof Error ? e.stack : void 0;
|
|
258
258
|
if (typeof t == "string") {
|
|
259
|
-
for (let [n, r] of
|
|
260
|
-
r(
|
|
259
|
+
for (let [n, r] of J) if (t.includes(n)) {
|
|
260
|
+
r(K(e, G.RUNTIME));
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
},
|
|
265
|
-
|
|
264
|
+
}, de = () => {
|
|
265
|
+
Y || typeof window > "u" || (Y = !0, window.addEventListener("error", (e) => {
|
|
266
266
|
let t = e.error || Error(e.message);
|
|
267
|
-
queueMicrotask(() =>
|
|
267
|
+
queueMicrotask(() => Z(t));
|
|
268
268
|
}), window.addEventListener("unhandledrejection", (e) => {
|
|
269
269
|
let t = e.reason;
|
|
270
|
-
queueMicrotask(() =>
|
|
270
|
+
queueMicrotask(() => Z(t));
|
|
271
271
|
}));
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
},
|
|
272
|
+
}, fe = (e, t) => {
|
|
273
|
+
de(), J.set(e, t);
|
|
274
|
+
}, pe = (e) => {
|
|
275
|
+
J.delete(e);
|
|
276
|
+
}, me = /(^|[\s,>+~(])(?::root\b|html\b|body\b)/gi, Q = (e) => typeof e != "string" || !e ? "" : e.replace(me, "$1:host"), he = class extends t {
|
|
277
277
|
state = { failed: !1 };
|
|
278
278
|
static getDerivedStateFromError() {
|
|
279
279
|
return { failed: !0 };
|
|
280
280
|
}
|
|
281
281
|
componentDidCatch(e) {
|
|
282
|
-
|
|
282
|
+
ue(e), this.props.onError(K(e, G.RENDER));
|
|
283
283
|
}
|
|
284
284
|
render() {
|
|
285
285
|
return this.state.failed ? null : this.props.children;
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, ge = new Set([
|
|
288
288
|
"form",
|
|
289
289
|
"table",
|
|
290
290
|
"card"
|
|
291
|
-
]),
|
|
292
|
-
view:
|
|
291
|
+
]), _e = (e) => ({
|
|
292
|
+
view: ge.has(e?.view) ? e?.view : "form",
|
|
293
293
|
platform: e?.platform === "mobile" ? "mobile" : "pc"
|
|
294
|
-
}),
|
|
294
|
+
}), $ = new Set([
|
|
295
295
|
"code",
|
|
296
296
|
"runToken",
|
|
297
297
|
"height",
|
|
@@ -306,70 +306,70 @@ var H = Object.keys(V), ce = (e) => {
|
|
|
306
306
|
"env",
|
|
307
307
|
"onChange",
|
|
308
308
|
"widget"
|
|
309
|
-
]),
|
|
309
|
+
]), ve = (e, t) => {
|
|
310
310
|
let n = e ?? {}, r = {
|
|
311
311
|
value: n.value ?? "",
|
|
312
312
|
disabled: !!n.disabled,
|
|
313
313
|
readOnly: !!n.readOnly,
|
|
314
314
|
formData: n.formData || {},
|
|
315
|
-
env:
|
|
315
|
+
env: _e(n.env),
|
|
316
316
|
onChange: t
|
|
317
317
|
};
|
|
318
318
|
for (let e of Object.keys(n)) {
|
|
319
319
|
let t = n[e];
|
|
320
|
-
t === void 0 ||
|
|
320
|
+
t === void 0 || $.has(e) || (r[e] = t);
|
|
321
321
|
}
|
|
322
322
|
return n.widget && (r.widget = n.widget), r;
|
|
323
|
-
},
|
|
323
|
+
}, ye = (e) => {
|
|
324
324
|
let t = Object.keys(e).sort(), n = "";
|
|
325
325
|
for (let r of t) {
|
|
326
326
|
let t = e[r];
|
|
327
327
|
typeof t == "function" ? n += `${r}:fn\0` : t !== void 0 && (typeof t != "object" || !t) && (n += `${r}:${String(t)}\0`);
|
|
328
328
|
}
|
|
329
329
|
return n;
|
|
330
|
-
},
|
|
330
|
+
}, be = (e, t) => {
|
|
331
331
|
let n = {};
|
|
332
332
|
for (let r of Object.keys(e)) {
|
|
333
333
|
let i = e[r];
|
|
334
|
-
i === void 0 ||
|
|
334
|
+
i === void 0 || $.has(r) || (typeof i == "function" ? n[r] = (...e) => {
|
|
335
335
|
let n = t()[r];
|
|
336
336
|
return typeof n == "function" ? n(...e) : void 0;
|
|
337
337
|
} : n[r] = i);
|
|
338
338
|
}
|
|
339
339
|
return n;
|
|
340
|
-
},
|
|
340
|
+
}, xe = {
|
|
341
341
|
ok: !1,
|
|
342
342
|
error: null,
|
|
343
343
|
Component: null
|
|
344
344
|
};
|
|
345
|
-
function
|
|
346
|
-
let t = ({ code: t, value:
|
|
347
|
-
let
|
|
348
|
-
|
|
349
|
-
onChange:
|
|
350
|
-
onError:
|
|
345
|
+
function Se(e) {
|
|
346
|
+
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
|
+
let S = o(null), C = o(null), w = o(null), T = o({});
|
|
348
|
+
T.current = {
|
|
349
|
+
onChange: y,
|
|
350
|
+
onError: b
|
|
351
351
|
};
|
|
352
|
-
let
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
let
|
|
352
|
+
let E = o(x);
|
|
353
|
+
E.current = x;
|
|
354
|
+
let D = o(null);
|
|
355
|
+
D.current === null && (D.current = ce(e));
|
|
356
|
+
let O = D.current, k = B(t), A = o({
|
|
357
357
|
source: void 0,
|
|
358
358
|
token: void 0,
|
|
359
|
-
result:
|
|
359
|
+
result: xe
|
|
360
360
|
});
|
|
361
|
-
if (
|
|
361
|
+
if (A.current.source !== t || A.current.token !== m) {
|
|
362
362
|
let e;
|
|
363
|
-
if (!
|
|
363
|
+
if (!k.ok) e = {
|
|
364
364
|
ok: !1,
|
|
365
|
-
error:
|
|
365
|
+
error: k.error,
|
|
366
366
|
Component: null
|
|
367
367
|
};
|
|
368
368
|
else try {
|
|
369
369
|
e = {
|
|
370
370
|
ok: !0,
|
|
371
371
|
error: null,
|
|
372
|
-
Component:
|
|
372
|
+
Component: le(k.code, O)
|
|
373
373
|
};
|
|
374
374
|
} catch (t) {
|
|
375
375
|
e = {
|
|
@@ -378,85 +378,85 @@ function we(e) {
|
|
|
378
378
|
Component: null
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
A.current = {
|
|
382
382
|
source: t,
|
|
383
|
-
token:
|
|
383
|
+
token: m,
|
|
384
384
|
result: e
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
|
-
let
|
|
388
|
-
if (
|
|
389
|
-
let e =
|
|
387
|
+
let j = A.current.result, M = n((e) => T.current.onChange?.(e), []), N = a(() => be(E.current, () => E.current), [ye(x)]), P = n((e) => T.current.onError?.(e), []), F = n(() => {
|
|
388
|
+
if (C.current) return C.current;
|
|
389
|
+
let e = S.current;
|
|
390
390
|
if (!e) return null;
|
|
391
391
|
let t = e.shadowRoot || e.attachShadow({ mode: "open" }), n = document.createElement("style"), r = document.createElement("div");
|
|
392
|
-
return r.setAttribute("data-ai-runtime-mount", ""), r.style.height = "100%", t.append(n, r),
|
|
393
|
-
root: ee(r, { onUncaughtError: (e) =>
|
|
392
|
+
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?.(K(e, G.RUNTIME)) }),
|
|
394
394
|
styleEl: n,
|
|
395
395
|
mountEl: r
|
|
396
|
-
},
|
|
397
|
-
}, []),
|
|
398
|
-
value:
|
|
399
|
-
disabled:
|
|
400
|
-
readOnly:
|
|
401
|
-
formData:
|
|
402
|
-
env:
|
|
403
|
-
widget:
|
|
404
|
-
...
|
|
405
|
-
},
|
|
406
|
-
i,
|
|
396
|
+
}, C.current;
|
|
397
|
+
}, []), I = a(() => ve({
|
|
398
|
+
value: s,
|
|
399
|
+
disabled: l,
|
|
400
|
+
readOnly: u,
|
|
401
|
+
formData: d,
|
|
402
|
+
env: f,
|
|
403
|
+
widget: p,
|
|
404
|
+
...N
|
|
405
|
+
}, M), [
|
|
407
406
|
s,
|
|
408
407
|
l,
|
|
409
408
|
u,
|
|
410
409
|
d,
|
|
411
410
|
f,
|
|
412
|
-
|
|
413
|
-
M
|
|
411
|
+
p,
|
|
412
|
+
M,
|
|
413
|
+
N
|
|
414
414
|
]);
|
|
415
|
-
|
|
416
|
-
let e =
|
|
415
|
+
i(() => {
|
|
416
|
+
let e = F();
|
|
417
417
|
if (!e) return;
|
|
418
418
|
let { root: t, styleEl: n } = e;
|
|
419
|
-
if (!
|
|
420
|
-
if (
|
|
421
|
-
let e =
|
|
422
|
-
|
|
419
|
+
if (!j.ok) {
|
|
420
|
+
if (w.current !== j && (w.current = j, n.textContent = "", t.render(null), j.error)) {
|
|
421
|
+
let e = k.ok ? G.EXECUTE : G.COMPILE;
|
|
422
|
+
T.current.onError?.(K(j.error, e));
|
|
423
423
|
}
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
-
|
|
427
|
-
let r =
|
|
426
|
+
w.current = null;
|
|
427
|
+
let r = Q(k.css);
|
|
428
428
|
n.textContent !== r && (n.textContent = r);
|
|
429
|
-
let i =
|
|
430
|
-
t.render(/* @__PURE__ */ c(
|
|
431
|
-
onError:
|
|
432
|
-
children: /* @__PURE__ */ c(i, { ...
|
|
429
|
+
let i = j.Component;
|
|
430
|
+
t.render(/* @__PURE__ */ c(he, {
|
|
431
|
+
onError: P,
|
|
432
|
+
children: /* @__PURE__ */ c(i, { ...I })
|
|
433
433
|
}));
|
|
434
434
|
}, [
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
k,
|
|
436
|
+
j,
|
|
437
|
+
I,
|
|
438
|
+
P,
|
|
439
|
+
F
|
|
440
440
|
]), r(() => () => {
|
|
441
|
-
let e =
|
|
442
|
-
|
|
443
|
-
}, []), r(() => (
|
|
444
|
-
let
|
|
445
|
-
height:
|
|
446
|
-
minHeight:
|
|
447
|
-
...
|
|
441
|
+
let e = C.current;
|
|
442
|
+
C.current = null, e && (e.styleEl.remove(), e.mountEl.remove(), queueMicrotask(() => e.root.unmount()));
|
|
443
|
+
}, []), r(() => (fe(O, (e) => T.current.onError?.(e)), () => pe(O)), [O]);
|
|
444
|
+
let L = {
|
|
445
|
+
height: h ?? "auto",
|
|
446
|
+
minHeight: g ?? 32,
|
|
447
|
+
...v
|
|
448
448
|
};
|
|
449
449
|
return /* @__PURE__ */ c("div", {
|
|
450
|
-
ref:
|
|
450
|
+
ref: S,
|
|
451
451
|
"data-ai-runtime-host": "",
|
|
452
|
-
className:
|
|
453
|
-
style:
|
|
452
|
+
className: _,
|
|
453
|
+
style: L
|
|
454
454
|
});
|
|
455
455
|
};
|
|
456
456
|
return t.displayName = "BsyAiRuntimeContainer", t;
|
|
457
457
|
}
|
|
458
458
|
//#endregion
|
|
459
459
|
//#region src/components/AiRuntimeContainer/index.ts
|
|
460
|
-
var
|
|
460
|
+
var Ce = Se("ui-mobile");
|
|
461
461
|
//#endregion
|
|
462
|
-
export {
|
|
462
|
+
export { Ce as AiRuntimeContainer, Ce as default, G as ERROR_CODE, W as MODULE_NAMES, k as assertFieldSource, re as clearCompileCache, R as compileAiCode, B as compileCached, Q as scopeCss, I as splitAiCode, ve 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-Cf4pY2bq.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
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./vendors/version-
|
|
1
|
+
import "./vendors/version-Cf4pY2bq.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";
|