@nuwatop/code-canvas-runtime 0.1.0 → 0.1.2

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/index.esm.js CHANGED
@@ -1,661 +1,33 @@
1
- var et = Object.defineProperty;
2
- var rt = (r, t, o) => t in r ? et(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
3
- var we = (r, t, o) => rt(r, typeof t != "symbol" ? t + "" : t, o);
4
- import * as tt from "@nuwatop/code-canvas-core";
5
- import { useAndStore as F, parseAction as nt, getCoreConfig as B, useStoreByName as ot } from "@nuwatop/code-canvas-core";
1
+ var de = Object.defineProperty;
2
+ var ue = (e, t, r) => t in e ? de(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var z = (e, t, r) => ue(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import * as pe from "@nuwatop/code-canvas-core";
5
+ import { useAndStore as v, parseAction as fe, getCoreConfig as x, useStoreByName as me } from "@nuwatop/code-canvas-core";
6
6
  export * from "@nuwatop/code-canvas-core";
7
- import Y, { useState as tr, useEffect as at, useMemo as re, Suspense as je } from "react";
8
- import { Spin as Pe, ConfigProvider as sr, message as it, Drawer as st, Modal as lt } from "antd";
9
- import { create as ut } from "zustand";
10
- import { produce as ct } from "immer";
11
- import ft from "react-dom";
12
- function dt(r) {
13
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
7
+ import { jsx as s, jsxs as E, Fragment as he } from "react/jsx-runtime";
8
+ import P, { useState as H, useEffect as ye, useMemo as $, Suspense as L } from "react";
9
+ import { Spin as I, ConfigProvider as Q, message as ve, Drawer as ge, Modal as be } from "antd";
10
+ import { create as xe } from "zustand";
11
+ import { produce as Ce } from "immer";
12
+ import { createRoot as B } from "react-dom/client";
13
+ function we(e) {
14
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
14
15
  }
15
- var Re = { exports: {} }, V = {};
16
- /**
17
- * @license React
18
- * react-jsx-runtime.production.min.js
19
- *
20
- * Copyright (c) Facebook, Inc. and its affiliates.
21
- *
22
- * This source code is licensed under the MIT license found in the
23
- * LICENSE file in the root directory of this source tree.
24
- */
25
- var nr;
26
- function pt() {
27
- if (nr) return V;
28
- nr = 1;
29
- var r = Y, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
30
- function u(v, f, x) {
31
- var b, E = {}, m = null, w = null;
32
- x !== void 0 && (m = "" + x), f.key !== void 0 && (m = "" + f.key), f.ref !== void 0 && (w = f.ref);
33
- for (b in f) i.call(f, b) && !s.hasOwnProperty(b) && (E[b] = f[b]);
34
- if (v && v.defaultProps) for (b in f = v.defaultProps, f) E[b] === void 0 && (E[b] = f[b]);
35
- return { $$typeof: t, type: v, key: m, ref: w, props: E, _owner: l.current };
36
- }
37
- return V.Fragment = o, V.jsx = u, V.jsxs = u, V;
38
- }
39
- var q = {};
40
- /**
41
- * @license React
42
- * react-jsx-runtime.development.js
43
- *
44
- * Copyright (c) Facebook, Inc. and its affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */
49
- var or;
50
- function vt() {
51
- return or || (or = 1, process.env.NODE_ENV !== "production" && function() {
52
- var r = Y, t = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), v = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), k = Symbol.iterator, A = "@@iterator";
53
- function de(e) {
54
- if (e === null || typeof e != "object")
55
- return null;
56
- var n = k && e[k] || e[A];
57
- return typeof n == "function" ? n : null;
58
- }
59
- var D = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
60
- function R(e) {
61
- {
62
- for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), c = 1; c < n; c++)
63
- a[c - 1] = arguments[c];
64
- pe("error", e, a);
65
- }
66
- }
67
- function pe(e, n, a) {
68
- {
69
- var c = D.ReactDebugCurrentFrame, h = c.getStackAddendum();
70
- h !== "" && (n += "%s", a = a.concat([h]));
71
- var g = a.map(function(p) {
72
- return String(p);
73
- });
74
- g.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, g);
75
- }
76
- }
77
- var _r = !1, xr = !1, Cr = !1, wr = !1, Rr = !1, ke;
78
- ke = Symbol.for("react.module.reference");
79
- function Er(e) {
80
- return !!(typeof e == "string" || typeof e == "function" || e === i || e === s || Rr || e === l || e === x || e === b || wr || e === w || _r || xr || Cr || typeof e == "object" && e !== null && (e.$$typeof === m || e.$$typeof === E || e.$$typeof === u || e.$$typeof === v || e.$$typeof === f || // This needs to include all possible module reference object
81
- // types supported by any Flight configuration anywhere since
82
- // we don't know which Flight build this will end up being used
83
- // with.
84
- e.$$typeof === ke || e.getModuleId !== void 0));
85
- }
86
- function jr(e, n, a) {
87
- var c = e.displayName;
88
- if (c)
89
- return c;
90
- var h = n.displayName || n.name || "";
91
- return h !== "" ? a + "(" + h + ")" : a;
92
- }
93
- function De(e) {
94
- return e.displayName || "Context";
95
- }
96
- function $(e) {
97
- if (e == null)
98
- return null;
99
- if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
100
- return e.displayName || e.name || null;
101
- if (typeof e == "string")
102
- return e;
103
- switch (e) {
104
- case i:
105
- return "Fragment";
106
- case o:
107
- return "Portal";
108
- case s:
109
- return "Profiler";
110
- case l:
111
- return "StrictMode";
112
- case x:
113
- return "Suspense";
114
- case b:
115
- return "SuspenseList";
116
- }
117
- if (typeof e == "object")
118
- switch (e.$$typeof) {
119
- case v:
120
- var n = e;
121
- return De(n) + ".Consumer";
122
- case u:
123
- var a = e;
124
- return De(a._context) + ".Provider";
125
- case f:
126
- return jr(e, e.render, "ForwardRef");
127
- case E:
128
- var c = e.displayName || null;
129
- return c !== null ? c : $(e.type) || "Memo";
130
- case m: {
131
- var h = e, g = h._payload, p = h._init;
132
- try {
133
- return $(p(g));
134
- } catch {
135
- return null;
136
- }
137
- }
138
- }
139
- return null;
140
- }
141
- var M = Object.assign, W = 0, Ae, Me, Ne, Fe, Ie, Le, Ye;
142
- function We() {
143
- }
144
- We.__reactDisabledLog = !0;
145
- function Pr() {
146
- {
147
- if (W === 0) {
148
- Ae = console.log, Me = console.info, Ne = console.warn, Fe = console.error, Ie = console.group, Le = console.groupCollapsed, Ye = console.groupEnd;
149
- var e = {
150
- configurable: !0,
151
- enumerable: !0,
152
- value: We,
153
- writable: !0
154
- };
155
- Object.defineProperties(console, {
156
- info: e,
157
- log: e,
158
- warn: e,
159
- error: e,
160
- group: e,
161
- groupCollapsed: e,
162
- groupEnd: e
163
- });
164
- }
165
- W++;
166
- }
167
- }
168
- function Sr() {
169
- {
170
- if (W--, W === 0) {
171
- var e = {
172
- configurable: !0,
173
- enumerable: !0,
174
- writable: !0
175
- };
176
- Object.defineProperties(console, {
177
- log: M({}, e, {
178
- value: Ae
179
- }),
180
- info: M({}, e, {
181
- value: Me
182
- }),
183
- warn: M({}, e, {
184
- value: Ne
185
- }),
186
- error: M({}, e, {
187
- value: Fe
188
- }),
189
- group: M({}, e, {
190
- value: Ie
191
- }),
192
- groupCollapsed: M({}, e, {
193
- value: Le
194
- }),
195
- groupEnd: M({}, e, {
196
- value: Ye
197
- })
198
- });
199
- }
200
- W < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
201
- }
202
- }
203
- var ve = D.ReactCurrentDispatcher, me;
204
- function G(e, n, a) {
205
- {
206
- if (me === void 0)
207
- try {
208
- throw Error();
209
- } catch (h) {
210
- var c = h.stack.trim().match(/\n( *(at )?)/);
211
- me = c && c[1] || "";
212
- }
213
- return `
214
- ` + me + e;
215
- }
216
- }
217
- var ye = !1, X;
218
- {
219
- var Or = typeof WeakMap == "function" ? WeakMap : Map;
220
- X = new Or();
221
- }
222
- function Ue(e, n) {
223
- if (!e || ye)
224
- return "";
225
- {
226
- var a = X.get(e);
227
- if (a !== void 0)
228
- return a;
229
- }
230
- var c;
231
- ye = !0;
232
- var h = Error.prepareStackTrace;
233
- Error.prepareStackTrace = void 0;
234
- var g;
235
- g = ve.current, ve.current = null, Pr();
236
- try {
237
- if (n) {
238
- var p = function() {
239
- throw Error();
240
- };
241
- if (Object.defineProperty(p.prototype, "props", {
242
- set: function() {
243
- throw Error();
244
- }
245
- }), typeof Reflect == "object" && Reflect.construct) {
246
- try {
247
- Reflect.construct(p, []);
248
- } catch (P) {
249
- c = P;
250
- }
251
- Reflect.construct(e, [], p);
252
- } else {
253
- try {
254
- p.call();
255
- } catch (P) {
256
- c = P;
257
- }
258
- e.call(p.prototype);
259
- }
260
- } else {
261
- try {
262
- throw Error();
263
- } catch (P) {
264
- c = P;
265
- }
266
- e();
267
- }
268
- } catch (P) {
269
- if (P && c && typeof P.stack == "string") {
270
- for (var d = P.stack.split(`
271
- `), j = c.stack.split(`
272
- `), _ = d.length - 1, C = j.length - 1; _ >= 1 && C >= 0 && d[_] !== j[C]; )
273
- C--;
274
- for (; _ >= 1 && C >= 0; _--, C--)
275
- if (d[_] !== j[C]) {
276
- if (_ !== 1 || C !== 1)
277
- do
278
- if (_--, C--, C < 0 || d[_] !== j[C]) {
279
- var O = `
280
- ` + d[_].replace(" at new ", " at ");
281
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, O), O;
282
- }
283
- while (_ >= 1 && C >= 0);
284
- break;
285
- }
286
- }
287
- } finally {
288
- ye = !1, ve.current = g, Sr(), Error.prepareStackTrace = h;
289
- }
290
- var L = e ? e.displayName || e.name : "", N = L ? G(L) : "";
291
- return typeof e == "function" && X.set(e, N), N;
292
- }
293
- function Tr(e, n, a) {
294
- return Ue(e, !1);
295
- }
296
- function $r(e) {
297
- var n = e.prototype;
298
- return !!(n && n.isReactComponent);
299
- }
300
- function Q(e, n, a) {
301
- if (e == null)
302
- return "";
303
- if (typeof e == "function")
304
- return Ue(e, $r(e));
305
- if (typeof e == "string")
306
- return G(e);
307
- switch (e) {
308
- case x:
309
- return G("Suspense");
310
- case b:
311
- return G("SuspenseList");
312
- }
313
- if (typeof e == "object")
314
- switch (e.$$typeof) {
315
- case f:
316
- return Tr(e.render);
317
- case E:
318
- return Q(e.type, n, a);
319
- case m: {
320
- var c = e, h = c._payload, g = c._init;
321
- try {
322
- return Q(g(h), n, a);
323
- } catch {
324
- }
325
- }
326
- }
327
- return "";
328
- }
329
- var U = Object.prototype.hasOwnProperty, ze = {}, Ve = D.ReactDebugCurrentFrame;
330
- function Z(e) {
331
- if (e) {
332
- var n = e._owner, a = Q(e.type, e._source, n ? n.type : null);
333
- Ve.setExtraStackFrame(a);
334
- } else
335
- Ve.setExtraStackFrame(null);
336
- }
337
- function kr(e, n, a, c, h) {
338
- {
339
- var g = Function.call.bind(U);
340
- for (var p in e)
341
- if (g(e, p)) {
342
- var d = void 0;
343
- try {
344
- if (typeof e[p] != "function") {
345
- var j = Error((c || "React class") + ": " + a + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
346
- throw j.name = "Invariant Violation", j;
347
- }
348
- d = e[p](n, p, c, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
349
- } catch (_) {
350
- d = _;
351
- }
352
- d && !(d instanceof Error) && (Z(h), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", a, p, typeof d), Z(null)), d instanceof Error && !(d.message in ze) && (ze[d.message] = !0, Z(h), R("Failed %s type: %s", a, d.message), Z(null));
353
- }
354
- }
355
- }
356
- var Dr = Array.isArray;
357
- function he(e) {
358
- return Dr(e);
359
- }
360
- function Ar(e) {
361
- {
362
- var n = typeof Symbol == "function" && Symbol.toStringTag, a = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
363
- return a;
364
- }
365
- }
366
- function Mr(e) {
367
- try {
368
- return qe(e), !1;
369
- } catch {
370
- return !0;
371
- }
372
- }
373
- function qe(e) {
374
- return "" + e;
375
- }
376
- function Be(e) {
377
- if (Mr(e))
378
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ar(e)), qe(e);
379
- }
380
- var z = D.ReactCurrentOwner, Nr = {
381
- key: !0,
382
- ref: !0,
383
- __self: !0,
384
- __source: !0
385
- }, Je, He, ge;
386
- ge = {};
387
- function Fr(e) {
388
- if (U.call(e, "ref")) {
389
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
390
- if (n && n.isReactWarning)
391
- return !1;
392
- }
393
- return e.ref !== void 0;
394
- }
395
- function Ir(e) {
396
- if (U.call(e, "key")) {
397
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
398
- if (n && n.isReactWarning)
399
- return !1;
400
- }
401
- return e.key !== void 0;
402
- }
403
- function Lr(e, n) {
404
- if (typeof e.ref == "string" && z.current && n && z.current.stateNode !== n) {
405
- var a = $(z.current.type);
406
- ge[a] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(z.current.type), e.ref), ge[a] = !0);
407
- }
408
- }
409
- function Yr(e, n) {
410
- {
411
- var a = function() {
412
- Je || (Je = !0, R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
413
- };
414
- a.isReactWarning = !0, Object.defineProperty(e, "key", {
415
- get: a,
416
- configurable: !0
417
- });
418
- }
419
- }
420
- function Wr(e, n) {
421
- {
422
- var a = function() {
423
- He || (He = !0, R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
424
- };
425
- a.isReactWarning = !0, Object.defineProperty(e, "ref", {
426
- get: a,
427
- configurable: !0
428
- });
429
- }
430
- }
431
- var Ur = function(e, n, a, c, h, g, p) {
432
- var d = {
433
- // This tag allows us to uniquely identify this as a React Element
434
- $$typeof: t,
435
- // Built-in properties that belong on the element
436
- type: e,
437
- key: n,
438
- ref: a,
439
- props: p,
440
- // Record the component responsible for creating this element.
441
- _owner: g
442
- };
443
- return d._store = {}, Object.defineProperty(d._store, "validated", {
444
- configurable: !1,
445
- enumerable: !1,
446
- writable: !0,
447
- value: !1
448
- }), Object.defineProperty(d, "_self", {
449
- configurable: !1,
450
- enumerable: !1,
451
- writable: !1,
452
- value: c
453
- }), Object.defineProperty(d, "_source", {
454
- configurable: !1,
455
- enumerable: !1,
456
- writable: !1,
457
- value: h
458
- }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
459
- };
460
- function zr(e, n, a, c, h) {
461
- {
462
- var g, p = {}, d = null, j = null;
463
- a !== void 0 && (Be(a), d = "" + a), Ir(n) && (Be(n.key), d = "" + n.key), Fr(n) && (j = n.ref, Lr(n, h));
464
- for (g in n)
465
- U.call(n, g) && !Nr.hasOwnProperty(g) && (p[g] = n[g]);
466
- if (e && e.defaultProps) {
467
- var _ = e.defaultProps;
468
- for (g in _)
469
- p[g] === void 0 && (p[g] = _[g]);
470
- }
471
- if (d || j) {
472
- var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
473
- d && Yr(p, C), j && Wr(p, C);
474
- }
475
- return Ur(e, d, j, h, c, z.current, p);
476
- }
477
- }
478
- var be = D.ReactCurrentOwner, Ke = D.ReactDebugCurrentFrame;
479
- function I(e) {
480
- if (e) {
481
- var n = e._owner, a = Q(e.type, e._source, n ? n.type : null);
482
- Ke.setExtraStackFrame(a);
483
- } else
484
- Ke.setExtraStackFrame(null);
485
- }
486
- var _e;
487
- _e = !1;
488
- function xe(e) {
489
- return typeof e == "object" && e !== null && e.$$typeof === t;
490
- }
491
- function Ge() {
492
- {
493
- if (be.current) {
494
- var e = $(be.current.type);
495
- if (e)
496
- return `
497
-
498
- Check the render method of \`` + e + "`.";
499
- }
500
- return "";
501
- }
502
- }
503
- function Vr(e) {
504
- return "";
505
- }
506
- var Xe = {};
507
- function qr(e) {
508
- {
509
- var n = Ge();
510
- if (!n) {
511
- var a = typeof e == "string" ? e : e.displayName || e.name;
512
- a && (n = `
513
-
514
- Check the top-level render call using <` + a + ">.");
515
- }
516
- return n;
517
- }
518
- }
519
- function Qe(e, n) {
520
- {
521
- if (!e._store || e._store.validated || e.key != null)
522
- return;
523
- e._store.validated = !0;
524
- var a = qr(n);
525
- if (Xe[a])
526
- return;
527
- Xe[a] = !0;
528
- var c = "";
529
- e && e._owner && e._owner !== be.current && (c = " It was passed a child from " + $(e._owner.type) + "."), I(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, c), I(null);
530
- }
531
- }
532
- function Ze(e, n) {
533
- {
534
- if (typeof e != "object")
535
- return;
536
- if (he(e))
537
- for (var a = 0; a < e.length; a++) {
538
- var c = e[a];
539
- xe(c) && Qe(c, n);
540
- }
541
- else if (xe(e))
542
- e._store && (e._store.validated = !0);
543
- else if (e) {
544
- var h = de(e);
545
- if (typeof h == "function" && h !== e.entries)
546
- for (var g = h.call(e), p; !(p = g.next()).done; )
547
- xe(p.value) && Qe(p.value, n);
548
- }
549
- }
550
- }
551
- function Br(e) {
552
- {
553
- var n = e.type;
554
- if (n == null || typeof n == "string")
555
- return;
556
- var a;
557
- if (typeof n == "function")
558
- a = n.propTypes;
559
- else if (typeof n == "object" && (n.$$typeof === f || // Note: Memo only checks outer props here.
560
- // Inner props are checked in the reconciler.
561
- n.$$typeof === E))
562
- a = n.propTypes;
563
- else
564
- return;
565
- if (a) {
566
- var c = $(n);
567
- kr(a, e.props, "prop", c, e);
568
- } else if (n.PropTypes !== void 0 && !_e) {
569
- _e = !0;
570
- var h = $(n);
571
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
572
- }
573
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
- }
575
- }
576
- function Jr(e) {
577
- {
578
- for (var n = Object.keys(e.props), a = 0; a < n.length; a++) {
579
- var c = n[a];
580
- if (c !== "children" && c !== "key") {
581
- I(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), I(null);
582
- break;
583
- }
584
- }
585
- e.ref !== null && (I(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
586
- }
587
- }
588
- var er = {};
589
- function rr(e, n, a, c, h, g) {
590
- {
591
- var p = Er(e);
592
- if (!p) {
593
- var d = "";
594
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
595
- var j = Vr();
596
- j ? d += j : d += Ge();
597
- var _;
598
- e === null ? _ = "null" : he(e) ? _ = "array" : e !== void 0 && e.$$typeof === t ? (_ = "<" + ($(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, d);
599
- }
600
- var C = zr(e, n, a, h, g);
601
- if (C == null)
602
- return C;
603
- if (p) {
604
- var O = n.children;
605
- if (O !== void 0)
606
- if (c)
607
- if (he(O)) {
608
- for (var L = 0; L < O.length; L++)
609
- Ze(O[L], e);
610
- Object.freeze && Object.freeze(O);
611
- } else
612
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
613
- else
614
- Ze(O, e);
615
- }
616
- if (U.call(n, "key")) {
617
- var N = $(e), P = Object.keys(n).filter(function(Zr) {
618
- return Zr !== "key";
619
- }), Ce = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
620
- if (!er[N + Ce]) {
621
- var Qr = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
622
- R(`A props object containing a "key" prop is being spread into JSX:
623
- let props = %s;
624
- <%s {...props} />
625
- React keys must be passed directly to JSX without using spread:
626
- let props = %s;
627
- <%s key={someKey} {...props} />`, Ce, N, Qr, N), er[N + Ce] = !0;
628
- }
629
- }
630
- return e === i ? Jr(C) : Br(C), C;
631
- }
632
- }
633
- function Hr(e, n, a) {
634
- return rr(e, n, a, !0);
635
- }
636
- function Kr(e, n, a) {
637
- return rr(e, n, a, !1);
638
- }
639
- var Gr = Kr, Xr = Hr;
640
- q.Fragment = i, q.jsx = Gr, q.jsxs = Xr;
641
- }()), q;
642
- }
643
- process.env.NODE_ENV === "production" ? Re.exports = pt() : Re.exports = vt();
644
- var y = Re.exports, ae = {}, lr = { exports: {} };
645
- (function(r) {
646
- function t(o) {
647
- return o && o.__esModule ? o : {
648
- default: o
16
+ var O = {}, G = { exports: {} };
17
+ (function(e) {
18
+ function t(r) {
19
+ return r && r.__esModule ? r : {
20
+ default: r
649
21
  };
650
22
  }
651
- r.exports = t, r.exports.__esModule = !0, r.exports.default = r.exports;
652
- })(lr);
653
- var ie = lr.exports, se = {};
654
- Object.defineProperty(se, "__esModule", {
23
+ e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
24
+ })(G);
25
+ var M = G.exports, A = {};
26
+ Object.defineProperty(A, "__esModule", {
655
27
  value: !0
656
28
  });
657
- se.default = void 0;
658
- var mt = {
29
+ A.default = void 0;
30
+ var _e = {
659
31
  // Options
660
32
  items_per_page: "条/页",
661
33
  jump_to: "跳至",
@@ -670,99 +42,99 @@ var mt = {
670
42
  next_3: "向后 3 页",
671
43
  page_size: "页码"
672
44
  };
673
- se.default = mt;
674
- var le = {}, J = {}, ue = {}, ur = { exports: {} }, cr = { exports: {} }, fr = { exports: {} }, dr = { exports: {} };
675
- (function(r) {
676
- function t(o) {
45
+ A.default = _e;
46
+ var D = {}, C = {}, N = {}, J = { exports: {} }, K = { exports: {} }, X = { exports: {} }, Z = { exports: {} };
47
+ (function(e) {
48
+ function t(r) {
677
49
  "@babel/helpers - typeof";
678
- return r.exports = t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
679
- return typeof i;
680
- } : function(i) {
681
- return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
682
- }, r.exports.__esModule = !0, r.exports.default = r.exports, t(o);
50
+ return e.exports = t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
51
+ return typeof n;
52
+ } : function(n) {
53
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
54
+ }, e.exports.__esModule = !0, e.exports.default = e.exports, t(r);
683
55
  }
684
- r.exports = t, r.exports.__esModule = !0, r.exports.default = r.exports;
685
- })(dr);
686
- var pr = dr.exports, vr = { exports: {} };
687
- (function(r) {
688
- var t = pr.default;
689
- function o(i, l) {
690
- if (t(i) != "object" || !i) return i;
691
- var s = i[Symbol.toPrimitive];
692
- if (s !== void 0) {
693
- var u = s.call(i, l || "default");
694
- if (t(u) != "object") return u;
56
+ e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
57
+ })(Z);
58
+ var ee = Z.exports, te = { exports: {} };
59
+ (function(e) {
60
+ var t = ee.default;
61
+ function r(n, a) {
62
+ if (t(n) != "object" || !n) return n;
63
+ var o = n[Symbol.toPrimitive];
64
+ if (o !== void 0) {
65
+ var l = o.call(n, a || "default");
66
+ if (t(l) != "object") return l;
695
67
  throw new TypeError("@@toPrimitive must return a primitive value.");
696
68
  }
697
- return (l === "string" ? String : Number)(i);
69
+ return (a === "string" ? String : Number)(n);
698
70
  }
699
- r.exports = o, r.exports.__esModule = !0, r.exports.default = r.exports;
700
- })(vr);
701
- var yt = vr.exports;
702
- (function(r) {
703
- var t = pr.default, o = yt;
704
- function i(l) {
705
- var s = o(l, "string");
706
- return t(s) == "symbol" ? s : s + "";
71
+ e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
72
+ })(te);
73
+ var $e = te.exports;
74
+ (function(e) {
75
+ var t = ee.default, r = $e;
76
+ function n(a) {
77
+ var o = r(a, "string");
78
+ return t(o) == "symbol" ? o : o + "";
707
79
  }
708
- r.exports = i, r.exports.__esModule = !0, r.exports.default = r.exports;
709
- })(fr);
710
- var ht = fr.exports;
711
- (function(r) {
712
- var t = ht;
713
- function o(i, l, s) {
714
- return (l = t(l)) in i ? Object.defineProperty(i, l, {
715
- value: s,
80
+ e.exports = n, e.exports.__esModule = !0, e.exports.default = e.exports;
81
+ })(X);
82
+ var Pe = X.exports;
83
+ (function(e) {
84
+ var t = Pe;
85
+ function r(n, a, o) {
86
+ return (a = t(a)) in n ? Object.defineProperty(n, a, {
87
+ value: o,
716
88
  enumerable: !0,
717
89
  configurable: !0,
718
90
  writable: !0
719
- }) : i[l] = s, i;
91
+ }) : n[a] = o, n;
720
92
  }
721
- r.exports = o, r.exports.__esModule = !0, r.exports.default = r.exports;
722
- })(cr);
723
- var gt = cr.exports;
724
- (function(r) {
725
- var t = gt;
726
- function o(l, s) {
727
- var u = Object.keys(l);
93
+ e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
94
+ })(K);
95
+ var Se = K.exports;
96
+ (function(e) {
97
+ var t = Se;
98
+ function r(a, o) {
99
+ var l = Object.keys(a);
728
100
  if (Object.getOwnPropertySymbols) {
729
- var v = Object.getOwnPropertySymbols(l);
730
- s && (v = v.filter(function(f) {
731
- return Object.getOwnPropertyDescriptor(l, f).enumerable;
732
- })), u.push.apply(u, v);
101
+ var i = Object.getOwnPropertySymbols(a);
102
+ o && (i = i.filter(function(d) {
103
+ return Object.getOwnPropertyDescriptor(a, d).enumerable;
104
+ })), l.push.apply(l, i);
733
105
  }
734
- return u;
106
+ return l;
735
107
  }
736
- function i(l) {
737
- for (var s = 1; s < arguments.length; s++) {
738
- var u = arguments[s] != null ? arguments[s] : {};
739
- s % 2 ? o(Object(u), !0).forEach(function(v) {
740
- t(l, v, u[v]);
741
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(u)) : o(Object(u)).forEach(function(v) {
742
- Object.defineProperty(l, v, Object.getOwnPropertyDescriptor(u, v));
108
+ function n(a) {
109
+ for (var o = 1; o < arguments.length; o++) {
110
+ var l = arguments[o] != null ? arguments[o] : {};
111
+ o % 2 ? r(Object(l), !0).forEach(function(i) {
112
+ t(a, i, l[i]);
113
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(l)) : r(Object(l)).forEach(function(i) {
114
+ Object.defineProperty(a, i, Object.getOwnPropertyDescriptor(l, i));
743
115
  });
744
116
  }
745
- return l;
117
+ return a;
746
118
  }
747
- r.exports = i, r.exports.__esModule = !0, r.exports.default = r.exports;
748
- })(ur);
749
- var bt = ur.exports, ce = {};
750
- Object.defineProperty(ce, "__esModule", {
119
+ e.exports = n, e.exports.__esModule = !0, e.exports.default = e.exports;
120
+ })(J);
121
+ var je = J.exports, k = {};
122
+ Object.defineProperty(k, "__esModule", {
751
123
  value: !0
752
124
  });
753
- ce.commonLocale = void 0;
754
- ce.commonLocale = {
125
+ k.commonLocale = void 0;
126
+ k.commonLocale = {
755
127
  yearFormat: "YYYY",
756
128
  dayFormat: "D",
757
129
  cellMeridiemFormat: "A",
758
130
  monthBeforeYear: !0
759
131
  };
760
- var _t = ie.default;
761
- Object.defineProperty(ue, "__esModule", {
132
+ var Oe = M.default;
133
+ Object.defineProperty(N, "__esModule", {
762
134
  value: !0
763
135
  });
764
- ue.default = void 0;
765
- var ar = _t(bt), xt = ce, Ct = (0, ar.default)((0, ar.default)({}, xt.commonLocale), {}, {
136
+ N.default = void 0;
137
+ var V = Oe(je), Me = k, Ae = (0, V.default)((0, V.default)({}, Me.commonLocale), {}, {
766
138
  locale: "zh_CN",
767
139
  today: "今天",
768
140
  now: "此刻",
@@ -790,24 +162,24 @@ var ar = _t(bt), xt = ce, Ct = (0, ar.default)((0, ar.default)({}, xt.commonLoca
790
162
  cellDateFormat: "D",
791
163
  monthBeforeYear: !1
792
164
  });
793
- ue.default = Ct;
794
- var H = {};
795
- Object.defineProperty(H, "__esModule", {
165
+ N.default = Ae;
166
+ var w = {};
167
+ Object.defineProperty(w, "__esModule", {
796
168
  value: !0
797
169
  });
798
- H.default = void 0;
799
- const wt = {
170
+ w.default = void 0;
171
+ const De = {
800
172
  placeholder: "请选择时间",
801
173
  rangePlaceholder: ["开始时间", "结束时间"]
802
174
  };
803
- H.default = wt;
804
- var mr = ie.default;
805
- Object.defineProperty(J, "__esModule", {
175
+ w.default = De;
176
+ var re = M.default;
177
+ Object.defineProperty(C, "__esModule", {
806
178
  value: !0
807
179
  });
808
- J.default = void 0;
809
- var Rt = mr(ue), Et = mr(H);
810
- const yr = {
180
+ C.default = void 0;
181
+ var Ne = re(N), ke = re(w);
182
+ const ne = {
811
183
  lang: Object.assign({
812
184
  placeholder: "请选择日期",
813
185
  yearPlaceholder: "请选择年份",
@@ -819,30 +191,30 @@ const yr = {
819
191
  rangeMonthPlaceholder: ["开始月份", "结束月份"],
820
192
  rangeQuarterPlaceholder: ["开始季度", "结束季度"],
821
193
  rangeWeekPlaceholder: ["开始周", "结束周"]
822
- }, Rt.default),
823
- timePickerLocale: Object.assign({}, Et.default)
194
+ }, Ne.default),
195
+ timePickerLocale: Object.assign({}, ke.default)
824
196
  };
825
- yr.lang.ok = "确定";
826
- J.default = yr;
827
- var jt = ie.default;
828
- Object.defineProperty(le, "__esModule", {
197
+ ne.lang.ok = "确定";
198
+ C.default = ne;
199
+ var Re = M.default;
200
+ Object.defineProperty(D, "__esModule", {
829
201
  value: !0
830
202
  });
831
- le.default = void 0;
832
- var Pt = jt(J);
833
- le.default = Pt.default;
834
- var fe = ie.default;
835
- Object.defineProperty(ae, "__esModule", {
203
+ D.default = void 0;
204
+ var ze = Re(C);
205
+ D.default = ze.default;
206
+ var R = M.default;
207
+ Object.defineProperty(O, "__esModule", {
836
208
  value: !0
837
209
  });
838
- ae.default = void 0;
839
- var St = fe(se), Ot = fe(le), Tt = fe(J), $t = fe(H);
840
- const S = "${label}不是一个有效的${type}", kt = {
210
+ O.default = void 0;
211
+ var Ee = R(A), Te = R(D), Le = R(C), Ie = R(w);
212
+ const f = "${label}不是一个有效的${type}", Fe = {
841
213
  locale: "zh-cn",
842
- Pagination: St.default,
843
- DatePicker: Tt.default,
844
- TimePicker: $t.default,
845
- Calendar: Ot.default,
214
+ Pagination: Ee.default,
215
+ DatePicker: Le.default,
216
+ TimePicker: Ie.default,
217
+ Calendar: Te.default,
846
218
  // locales for all components
847
219
  global: {
848
220
  placeholder: "请选择",
@@ -927,19 +299,19 @@ const S = "${label}不是一个有效的${type}", kt = {
927
299
  invalid: "${label}是一个无效日期"
928
300
  },
929
301
  types: {
930
- string: S,
931
- method: S,
932
- array: S,
933
- object: S,
934
- number: S,
935
- date: S,
936
- boolean: S,
937
- integer: S,
938
- float: S,
939
- regexp: S,
940
- email: S,
941
- url: S,
942
- hex: S
302
+ string: f,
303
+ method: f,
304
+ array: f,
305
+ object: f,
306
+ number: f,
307
+ date: f,
308
+ boolean: f,
309
+ integer: f,
310
+ float: f,
311
+ regexp: f,
312
+ email: f,
313
+ url: f,
314
+ hex: f
943
315
  },
944
316
  string: {
945
317
  len: "${label}须为${len}个字符",
@@ -979,184 +351,184 @@ const S = "${label}不是一个有效的${type}", kt = {
979
351
  gradientColor: "渐变色"
980
352
  }
981
353
  };
982
- ae.default = kt;
983
- var Dt = ae;
984
- const Se = /* @__PURE__ */ dt(Dt), T = /* @__PURE__ */ new Map(), At = () => {
985
- const r = tt;
986
- Object.keys(r).forEach((t) => {
987
- if (t.startsWith("And") && typeof r[t] == "function") {
988
- const o = t.toLowerCase().replace("and", "and-");
989
- T.set(o, r[t]), T.set(t, r[t]);
354
+ O.default = Fe;
355
+ var Ye = O;
356
+ const F = /* @__PURE__ */ we(Ye), m = /* @__PURE__ */ new Map(), qe = () => {
357
+ const e = pe;
358
+ Object.keys(e).forEach((t) => {
359
+ if (t.startsWith("And") && typeof e[t] == "function") {
360
+ const r = t.toLowerCase().replace("and", "and-");
361
+ m.set(r, e[t]), m.set(t, e[t]);
990
362
  }
991
363
  });
992
364
  };
993
- At();
994
- const Mt = (r, t) => {
995
- T.set(r, t), T.set(r.toLowerCase(), t);
996
- }, Oe = (r) => {
997
- let t = T.get(r);
998
- return t || (t = T.get(r.toLowerCase()), t) || !r.startsWith("And") && (t = T.get(`And${r}`), t) || r.startsWith("and-") || (t = T.get(`and-${r.toLowerCase()}`)), t;
999
- }, Nt = () => Array.from(T.keys()), cn = {
1000
- register: Mt,
1001
- get: Oe,
1002
- getAll: Nt,
1003
- has: (r) => T.has(r) || T.has(r.toLowerCase())
1004
- }, Ft = (r) => {
365
+ qe();
366
+ const Ue = (e, t) => {
367
+ m.set(e, t), m.set(e.toLowerCase(), t);
368
+ }, Y = (e) => {
369
+ let t = m.get(e);
370
+ return t || (t = m.get(e.toLowerCase()), t) || !e.startsWith("And") && (t = m.get(`And${e}`), t) || e.startsWith("and-") || (t = m.get(`and-${e.toLowerCase()}`)), t;
371
+ }, We = () => Array.from(m.keys()), gt = {
372
+ register: Ue,
373
+ get: Y,
374
+ getAll: We,
375
+ has: (e) => m.has(e) || m.has(e.toLowerCase())
376
+ }, He = (e) => {
1005
377
  try {
1006
- const t = JSON.parse(r);
1007
- return It(t);
378
+ const t = JSON.parse(e);
379
+ return Ve(t);
1008
380
  } catch (t) {
1009
381
  throw new Error(`Failed to parse page config: ${t}`);
1010
382
  }
1011
- }, It = (r) => {
1012
- if (!r)
383
+ }, Ve = (e) => {
384
+ if (!e)
1013
385
  throw new Error("Page config is empty");
1014
- return r.html || r.components ? {
1015
- id: r.id,
1016
- title: r.title,
1017
- style: r.style,
1018
- components: Ee(r.components || []),
1019
- dataSets: r.dataSets || {},
1020
- actions: r.actions || {}
1021
- } : r;
1022
- }, Ee = (r) => Array.isArray(r) ? r.map((t) => {
1023
- var o;
386
+ return e.html || e.components ? {
387
+ id: e.id,
388
+ title: e.title,
389
+ style: e.style,
390
+ components: T(e.components || []),
391
+ dataSets: e.dataSets || {},
392
+ actions: e.actions || {}
393
+ } : e;
394
+ }, T = (e) => Array.isArray(e) ? e.map((t) => {
395
+ var r;
1024
396
  return t.tagName || t["data-gjs-type"] ? {
1025
- id: ((o = t.attributes) == null ? void 0 : o.id) || t.id,
397
+ id: ((r = t.attributes) == null ? void 0 : r.id) || t.id,
1026
398
  type: t["data-gjs-type"] || t.tagName || "div",
1027
399
  props: { ...t.attributes },
1028
- children: t.components ? Ee(t.components) : void 0,
400
+ children: t.components ? T(t.components) : void 0,
1029
401
  style: t.style
1030
402
  } : {
1031
403
  id: t.id,
1032
404
  type: t.type,
1033
405
  props: t.props || {},
1034
- children: t.children ? Ee(t.children) : void 0,
406
+ children: t.children ? T(t.children) : void 0,
1035
407
  style: t.style
1036
408
  };
1037
- }) : [], Lt = Pe, Yt = sr, fn = ({
1038
- pageConfig: r,
409
+ }) : [], Qe = I, Be = Q, bt = ({
410
+ pageConfig: e,
1039
411
  sessionId: t = `runtime_${Date.now()}`,
1040
- develop: o = !1,
1041
- theme: i,
1042
- loading: l = !1,
1043
- onError: s
412
+ develop: r = !1,
413
+ theme: n,
414
+ loading: a = !1,
415
+ onError: o
1044
416
  }) => {
1045
- const [u, v] = tr(null), [f, x] = tr(null);
1046
- at(() => {
417
+ const [l, i] = H(null), [d, p] = H(null);
418
+ ye(() => {
1047
419
  try {
1048
- const m = typeof r == "string" ? Ft(r) : r;
1049
- v(m), x(null);
1050
- } catch (m) {
1051
- const w = m instanceof Error ? m : new Error(String(m));
1052
- x(w), s == null || s(w);
1053
- }
1054
- }, [r, s]);
1055
- const b = (m, w) => {
1056
- var D;
1057
- const k = Oe(m.type);
1058
- if (!k)
1059
- return o ? /* @__PURE__ */ y.jsxs("div", { style: { padding: 8, background: "#fff1f0", border: "1px solid #ffa39e", borderRadius: 4 }, children: [
420
+ const c = typeof e == "string" ? He(e) : e;
421
+ i(c), p(null);
422
+ } catch (c) {
423
+ const u = c instanceof Error ? c : new Error(String(c));
424
+ p(u), o == null || o(u);
425
+ }
426
+ }, [e, o]);
427
+ const h = (c, u) => {
428
+ var W;
429
+ const g = Y(c.type);
430
+ if (!g)
431
+ return r ? /* @__PURE__ */ E("div", { style: { padding: 8, background: "#fff1f0", border: "1px solid #ffa39e", borderRadius: 4 }, children: [
1060
432
  "未知组件: ",
1061
- m.type
1062
- ] }, m.id || w) : (console.warn(`Unknown component type: ${m.type}`), null);
1063
- const A = {
1064
- ...m.props,
1065
- id: m.id,
433
+ c.type
434
+ ] }, c.id || u) : (console.warn(`Unknown component type: ${c.type}`), null);
435
+ const b = {
436
+ ...c.props,
437
+ id: c.id,
1066
438
  sessionId: t,
1067
- develop: o,
1068
- key: m.id || w
1069
- }, de = (D = m.children) == null ? void 0 : D.map((R, pe) => b(R, pe));
1070
- return Y.createElement(k, A, de);
1071
- }, E = re(() => l ? /* @__PURE__ */ y.jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: 200 }, children: /* @__PURE__ */ y.jsx(Lt, { size: "large" }) }) : f ? /* @__PURE__ */ y.jsxs("div", { style: { padding: 24, background: "#fff2f0", border: "1px solid #ffccc7", borderRadius: 8 }, children: [
1072
- /* @__PURE__ */ y.jsx("h3", { style: { color: "#cf1322" }, children: "渲染错误" }),
1073
- /* @__PURE__ */ y.jsx("p", { children: f.message })
1074
- ] }) : u ? /* @__PURE__ */ y.jsx("div", { className: "runtime-container", style: u.style, children: u.components.map((m, w) => b(m, w)) }) : null, [l, f, u, t, o]);
1075
- return /* @__PURE__ */ y.jsx(Yt, { locale: Se, theme: i, children: E });
1076
- }, Wt = (r) => (t, o, i) => (i.setState = (l, s, ...u) => {
1077
- const v = typeof l == "function" ? ct(l) : l;
1078
- return t(v, s, ...u);
1079
- }, r(i.setState, o, i)), Ut = Wt, dn = ut()(
1080
- Ut((r) => ({
439
+ develop: r,
440
+ key: c.id || u
441
+ }, se = (W = c.children) == null ? void 0 : W.map((ie, ce) => h(ie, ce));
442
+ return P.createElement(g, b, se);
443
+ }, y = $(() => a ? /* @__PURE__ */ s("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: 200 }, children: /* @__PURE__ */ s(Qe, { size: "large" }) }) : d ? /* @__PURE__ */ E("div", { style: { padding: 24, background: "#fff2f0", border: "1px solid #ffccc7", borderRadius: 8 }, children: [
444
+ /* @__PURE__ */ s("h3", { style: { color: "#cf1322" }, children: "渲染错误" }),
445
+ /* @__PURE__ */ s("p", { children: d.message })
446
+ ] }) : l ? /* @__PURE__ */ s("div", { className: "runtime-container", style: l.style, children: l.components.map((c, u) => h(c, u)) }) : null, [a, d, l, t, r]);
447
+ return /* @__PURE__ */ s(Be, { locale: F, theme: n, children: y });
448
+ }, Ge = (e) => (t, r, n) => (n.setState = (a, o, ...l) => {
449
+ const i = typeof a == "function" ? Ce(a) : a;
450
+ return t(i, o, ...l);
451
+ }, e(n.setState, r, n)), Je = Ge, xt = xe()(
452
+ Je((e) => ({
1081
453
  currentPageId: null,
1082
454
  pageConfigs: {},
1083
455
  loading: !1,
1084
456
  error: null,
1085
- setCurrentPage: (t) => r((o) => {
1086
- o.currentPageId = t;
457
+ setCurrentPage: (t) => e((r) => {
458
+ r.currentPageId = t;
1087
459
  }),
1088
- setPageConfig: (t, o) => r((i) => {
1089
- i.pageConfigs[t] = o;
460
+ setPageConfig: (t, r) => e((n) => {
461
+ n.pageConfigs[t] = r;
1090
462
  }),
1091
- setLoading: (t) => r((o) => {
1092
- o.loading = t;
463
+ setLoading: (t) => e((r) => {
464
+ r.loading = t;
1093
465
  }),
1094
- setError: (t) => r((o) => {
1095
- o.error = t;
466
+ setError: (t) => e((r) => {
467
+ r.error = t;
1096
468
  }),
1097
- clearCache: () => r((t) => {
469
+ clearCache: () => e((t) => {
1098
470
  t.pageConfigs = {};
1099
471
  })
1100
472
  }))
1101
- ), Te = /* @__PURE__ */ new Map(), K = (r, t) => {
1102
- Te.set(r, t);
1103
- }, zt = async (r, t) => {
1104
- const { actionName: o, arg: i } = nt(r, t.value), l = Te.get(o);
1105
- if (l)
1106
- return l(t, i);
1107
- const s = F.getState().addCommand;
1108
- return s(t.sessionId, {
1109
- actionName: o,
1110
- arg: i,
473
+ ), q = /* @__PURE__ */ new Map(), _ = (e, t) => {
474
+ q.set(e, t);
475
+ }, Ke = async (e, t) => {
476
+ const { actionName: r, arg: n } = fe(e, t.value), a = q.get(r);
477
+ if (a)
478
+ return a(t, n);
479
+ const o = v.getState().addCommand;
480
+ return o(t.sessionId, {
481
+ actionName: r,
482
+ arg: n,
1111
483
  timestamp: Date.now()
1112
- }), { actionName: o, arg: i };
484
+ }), { actionName: r, arg: n };
1113
485
  };
1114
- K("setDataSet", (r, t) => {
1115
- const { setDataSet: o } = F.getState();
1116
- t != null && t.dataSet && (t == null ? void 0 : t.field) !== void 0 && o(t.dataSet, t.field, t.value);
486
+ _("setDataSet", (e, t) => {
487
+ const { setDataSet: r } = v.getState();
488
+ t != null && t.dataSet && (t == null ? void 0 : t.field) !== void 0 && r(t.dataSet, t.field, t.value);
1117
489
  });
1118
- K("navigate", (r, t) => {
490
+ _("navigate", (e, t) => {
1119
491
  typeof window < "u" && (t != null && t.url) && (t.target === "_blank" ? window.open(t.url, "_blank") : window.location.href = t.url);
1120
492
  });
1121
- K("alert", (r, t) => {
493
+ _("alert", (e, t) => {
1122
494
  typeof window < "u" && window.alert((t == null ? void 0 : t.message) || t);
1123
495
  });
1124
- K("console", (r, t) => {
496
+ _("console", (e, t) => {
1125
497
  });
1126
- const pn = {
1127
- execute: zt,
1128
- register: K,
1129
- hasHandler: (r) => Te.has(r)
1130
- }, Vt = Pe, vn = ({
1131
- componentName: r,
498
+ const Ct = {
499
+ execute: Ke,
500
+ register: _,
501
+ hasHandler: (e) => q.has(e)
502
+ }, Xe = I, wt = ({
503
+ componentName: e,
1132
504
  componentProps: t = {},
1133
- storePropsKey: o,
1134
- sessionId: i,
1135
- loadingFallback: l,
1136
- notFoundFallback: s,
1137
- onError: u
505
+ storePropsKey: r,
506
+ sessionId: n,
507
+ loadingFallback: a,
508
+ notFoundFallback: o,
509
+ onError: l
1138
510
  }) => {
1139
- const v = F((m) => {
1140
- if (!o) return null;
1141
- const k = o.split(".")[0];
1142
- return m.dataSets[k];
1143
- }), f = re(() => {
1144
- if (!o || !v) return {};
1145
- const w = o.split(".")[1];
1146
- return w ? v[w] || {} : v;
1147
- }, [o, v]), x = re(() => ({
1148
- ...f,
511
+ const i = v((c) => {
512
+ if (!r) return null;
513
+ const g = r.split(".")[0];
514
+ return c.dataSets[g];
515
+ }), d = $(() => {
516
+ if (!r || !i) return {};
517
+ const u = r.split(".")[1];
518
+ return u ? i[u] || {} : i;
519
+ }, [r, i]), p = $(() => ({
520
+ ...d,
1149
521
  ...t,
1150
- sessionId: i
1151
- }), [f, t, i]), b = re(() => {
522
+ sessionId: n
523
+ }), [d, t, n]), h = $(() => {
1152
524
  try {
1153
- return Oe(r);
1154
- } catch (m) {
1155
- const w = m instanceof Error ? m : new Error(String(m));
1156
- return u == null || u(w), null;
525
+ return Y(e);
526
+ } catch (c) {
527
+ const u = c instanceof Error ? c : new Error(String(c));
528
+ return l == null || l(u), null;
1157
529
  }
1158
- }, [r, u]), E = /* @__PURE__ */ y.jsx("div", { style: { display: "flex", justifyContent: "center", padding: 24 }, children: /* @__PURE__ */ y.jsx(Vt, {}) });
1159
- return b ? /* @__PURE__ */ y.jsx(je, { fallback: l || E, children: /* @__PURE__ */ y.jsx(b, { ...x }) }) : s ? /* @__PURE__ */ y.jsx(y.Fragment, { children: s }) : /* @__PURE__ */ y.jsxs("div", { style: {
530
+ }, [e, l]), y = /* @__PURE__ */ s("div", { style: { display: "flex", justifyContent: "center", padding: 24 }, children: /* @__PURE__ */ s(Xe, {}) });
531
+ return h ? /* @__PURE__ */ s(L, { fallback: a || y, children: /* @__PURE__ */ s(h, { ...p }) }) : o ? /* @__PURE__ */ s(he, { children: o }) : /* @__PURE__ */ E("div", { style: {
1160
532
  padding: 16,
1161
533
  background: "#fff7e6",
1162
534
  border: "1px solid #ffd591",
@@ -1165,28 +537,13 @@ const pn = {
1165
537
  color: "#d46b08"
1166
538
  }, children: [
1167
539
  "组件未找到: ",
1168
- r
540
+ e
1169
541
  ] });
1170
- };
1171
- var te, ee = ft;
1172
- if (process.env.NODE_ENV === "production")
1173
- te = ee.createRoot, ee.hydrateRoot;
1174
- else {
1175
- var ir = ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1176
- te = function(r, t) {
1177
- ir.usingClientEntryPoint = !0;
1178
- try {
1179
- return ee.createRoot(r, t);
1180
- } finally {
1181
- ir.usingClientEntryPoint = !1;
1182
- }
1183
- };
1184
- }
1185
- const qt = st, Bt = lt, ne = Pe, hr = sr;
1186
- class Jt {
542
+ }, Ze = ge, et = be, S = I, oe = Q;
543
+ class tt {
1187
544
  constructor() {
1188
- we(this, "drawers", /* @__PURE__ */ new Map());
1189
- we(this, "isSetup", !1);
545
+ z(this, "drawers", /* @__PURE__ */ new Map());
546
+ z(this, "isSetup", !1);
1190
547
  }
1191
548
  /**
1192
549
  * 添加 Drawer 实例
@@ -1207,8 +564,8 @@ class Jt {
1207
564
  this.drawers.forEach((t) => {
1208
565
  try {
1209
566
  t.cleanup();
1210
- } catch (o) {
1211
- console.error("Failed to cleanup drawer:", o);
567
+ } catch (r) {
568
+ console.error("Failed to cleanup drawer:", r);
1212
569
  }
1213
570
  }), this.drawers.clear();
1214
571
  }
@@ -1227,17 +584,17 @@ class Jt {
1227
584
  }), typeof import.meta < "u");
1228
585
  }
1229
586
  }
1230
- const oe = new Jt(), gr = () => `drawer-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, Ht = ({ options: r, onClose: t, Component: o }) => {
1231
- const [i, l] = Y.useState(!0), s = B(), u = () => {
1232
- var E;
1233
- l(!1), (E = r.onClose) == null || E.call(r), setTimeout(() => {
587
+ const j = new tt(), ae = () => `drawer-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, rt = ({ options: e, onClose: t, Component: r }) => {
588
+ const [n, a] = P.useState(!0), o = x(), l = () => {
589
+ var y;
590
+ a(!1), (y = e.onClose) == null || y.call(e), setTimeout(() => {
1234
591
  t();
1235
592
  }, 300);
1236
- }, { component: v, componentName: f, componentProps: x, ...b } = r;
1237
- return /* @__PURE__ */ y.jsx(hr, { locale: Se, theme: s.theme, children: /* @__PURE__ */ y.jsx(qt, { ...b, open: i, onClose: u, destroyOnClose: !0, children: o ? /* @__PURE__ */ y.jsx(
1238
- je,
593
+ }, { component: i, componentName: d, componentProps: p, ...h } = e;
594
+ return /* @__PURE__ */ s(oe, { locale: F, theme: o.theme, children: /* @__PURE__ */ s(Ze, { ...h, open: n, onClose: l, destroyOnClose: !0, children: r ? /* @__PURE__ */ s(
595
+ L,
1239
596
  {
1240
- fallback: /* @__PURE__ */ y.jsx(
597
+ fallback: /* @__PURE__ */ s(
1241
598
  "div",
1242
599
  {
1243
600
  style: {
@@ -1245,12 +602,12 @@ const oe = new Jt(), gr = () => `drawer-${Date.now()}-${Math.random().toString(3
1245
602
  justifyContent: "center",
1246
603
  padding: 40
1247
604
  },
1248
- children: /* @__PURE__ */ y.jsx(ne, {})
605
+ children: /* @__PURE__ */ s(S, {})
1249
606
  }
1250
607
  ),
1251
- children: /* @__PURE__ */ y.jsx(o, { ...x || {}, onClose: u })
608
+ children: /* @__PURE__ */ s(r, { ...p || {}, onClose: l })
1252
609
  }
1253
- ) : /* @__PURE__ */ y.jsx(
610
+ ) : /* @__PURE__ */ s(
1254
611
  "div",
1255
612
  {
1256
613
  style: {
@@ -1259,41 +616,41 @@ const oe = new Jt(), gr = () => `drawer-${Date.now()}-${Math.random().toString(3
1259
616
  alignItems: "center",
1260
617
  height: "100%"
1261
618
  },
1262
- children: /* @__PURE__ */ y.jsx(ne, { tip: "加载中..." })
619
+ children: /* @__PURE__ */ s(S, { tip: "加载中..." })
1263
620
  }
1264
621
  ) }) });
1265
- }, Kt = ({ options: r, onClose: t, Component: o }) => {
1266
- const [i, l] = Y.useState(!0), [s, u] = Y.useState(!1), v = B(), f = () => {
1267
- var A;
1268
- l(!1), (A = r.onClose) == null || A.call(r), setTimeout(() => {
622
+ }, nt = ({ options: e, onClose: t, Component: r }) => {
623
+ const [n, a] = P.useState(!0), [o, l] = P.useState(!1), i = x(), d = () => {
624
+ var b;
625
+ a(!1), (b = e.onClose) == null || b.call(e), setTimeout(() => {
1269
626
  t();
1270
627
  }, 300);
1271
- }, x = async () => {
1272
- if (r.onOk) {
1273
- u(!0);
628
+ }, p = async () => {
629
+ if (e.onOk) {
630
+ l(!0);
1274
631
  try {
1275
- await r.onOk(), f();
1276
- } catch (A) {
1277
- console.error("Modal onOk error:", A);
632
+ await e.onOk(), d();
633
+ } catch (b) {
634
+ console.error("Modal onOk error:", b);
1278
635
  } finally {
1279
- u(!1);
636
+ l(!1);
1280
637
  }
1281
638
  } else
1282
- f();
1283
- }, { component: b, componentName: E, componentProps: m, onOk: w, ...k } = r;
1284
- return /* @__PURE__ */ y.jsx(hr, { locale: Se, theme: v.theme, children: /* @__PURE__ */ y.jsx(
1285
- Bt,
639
+ d();
640
+ }, { component: h, componentName: y, componentProps: c, onOk: u, ...g } = e;
641
+ return /* @__PURE__ */ s(oe, { locale: F, theme: i.theme, children: /* @__PURE__ */ s(
642
+ et,
1286
643
  {
1287
- ...k,
1288
- open: i,
1289
- onCancel: f,
1290
- onOk: x,
1291
- confirmLoading: s,
644
+ ...g,
645
+ open: n,
646
+ onCancel: d,
647
+ onOk: p,
648
+ confirmLoading: o,
1292
649
  destroyOnClose: !0,
1293
- children: o ? /* @__PURE__ */ y.jsx(
1294
- je,
650
+ children: r ? /* @__PURE__ */ s(
651
+ L,
1295
652
  {
1296
- fallback: /* @__PURE__ */ y.jsx(
653
+ fallback: /* @__PURE__ */ s(
1297
654
  "div",
1298
655
  {
1299
656
  style: {
@@ -1301,12 +658,12 @@ const oe = new Jt(), gr = () => `drawer-${Date.now()}-${Math.random().toString(3
1301
658
  justifyContent: "center",
1302
659
  padding: 40
1303
660
  },
1304
- children: /* @__PURE__ */ y.jsx(ne, {})
661
+ children: /* @__PURE__ */ s(S, {})
1305
662
  }
1306
663
  ),
1307
- children: /* @__PURE__ */ y.jsx(o, { ...m || {}, onClose: f })
664
+ children: /* @__PURE__ */ s(r, { ...c || {}, onClose: d })
1308
665
  }
1309
- ) : /* @__PURE__ */ y.jsx(
666
+ ) : /* @__PURE__ */ s(
1310
667
  "div",
1311
668
  {
1312
669
  style: {
@@ -1315,148 +672,148 @@ const oe = new Jt(), gr = () => `drawer-${Date.now()}-${Math.random().toString(3
1315
672
  alignItems: "center",
1316
673
  minHeight: 100
1317
674
  },
1318
- children: /* @__PURE__ */ y.jsx(ne, { tip: "加载中..." })
675
+ children: /* @__PURE__ */ s(S, { tip: "加载中..." })
1319
676
  }
1320
677
  )
1321
678
  }
1322
679
  ) });
1323
680
  };
1324
- function Gt(r) {
1325
- const t = gr(), o = document.createElement("div");
1326
- o.setAttribute("data-drawer-container", "true"), o.setAttribute("data-drawer-id", t), document.body.appendChild(o);
1327
- const i = te(o), l = () => {
1328
- var u;
681
+ function ot(e) {
682
+ const t = ae(), r = document.createElement("div");
683
+ r.setAttribute("data-drawer-container", "true"), r.setAttribute("data-drawer-id", t), document.body.appendChild(r);
684
+ const n = B(r), a = () => {
685
+ var l;
1329
686
  try {
1330
- oe.remove(t), i.unmount(), o.remove(), (u = r.afterClose) == null || u.call(r);
1331
- } catch (v) {
1332
- console.error("Drawer cleanup failed:", v);
687
+ j.remove(t), n.unmount(), r.remove(), (l = e.afterClose) == null || l.call(e);
688
+ } catch (i) {
689
+ console.error("Drawer cleanup failed:", i);
1333
690
  }
1334
691
  };
1335
- oe.add({ id: t, root: i, mountNode: o, cleanup: l });
1336
- let s = r.component || null;
1337
- if (!s && r.componentName) {
1338
- const u = B();
1339
- u.componentResolver ? s = u.componentResolver(r.componentName) : console.warn(
692
+ j.add({ id: t, root: n, mountNode: r, cleanup: a });
693
+ let o = e.component || null;
694
+ if (!o && e.componentName) {
695
+ const l = x();
696
+ l.componentResolver ? o = l.componentResolver(e.componentName) : console.warn(
1340
697
  "[UIUtils.showDrawer] componentResolver not configured. Cannot resolve component:",
1341
- r.componentName
698
+ e.componentName
1342
699
  );
1343
700
  }
1344
- return i.render(
1345
- /* @__PURE__ */ y.jsx(Ht, { options: r, onClose: l, Component: s })
1346
- ), l;
701
+ return n.render(
702
+ /* @__PURE__ */ s(rt, { options: e, onClose: a, Component: o })
703
+ ), a;
1347
704
  }
1348
- function Xt(r) {
1349
- const t = gr(), o = document.createElement("div");
1350
- o.setAttribute("data-modal-container", "true"), o.setAttribute("data-modal-id", t), document.body.appendChild(o);
1351
- const i = te(o), l = () => {
705
+ function at(e) {
706
+ const t = ae(), r = document.createElement("div");
707
+ r.setAttribute("data-modal-container", "true"), r.setAttribute("data-modal-id", t), document.body.appendChild(r);
708
+ const n = B(r), a = () => {
1352
709
  try {
1353
- i.unmount(), o.remove();
1354
- } catch (u) {
1355
- console.error("Modal cleanup failed:", u);
710
+ n.unmount(), r.remove();
711
+ } catch (l) {
712
+ console.error("Modal cleanup failed:", l);
1356
713
  }
1357
714
  };
1358
- let s = r.component || null;
1359
- if (!s && r.componentName) {
1360
- const u = B();
1361
- u.componentResolver ? s = u.componentResolver(r.componentName) : console.warn(
715
+ let o = e.component || null;
716
+ if (!o && e.componentName) {
717
+ const l = x();
718
+ l.componentResolver ? o = l.componentResolver(e.componentName) : console.warn(
1362
719
  "[UIUtils.showModal] componentResolver not configured. Cannot resolve component:",
1363
- r.componentName
720
+ e.componentName
1364
721
  );
1365
722
  }
1366
- return i.render(
1367
- /* @__PURE__ */ y.jsx(Kt, { options: r, onClose: l, Component: s })
1368
- ), l;
723
+ return n.render(
724
+ /* @__PURE__ */ s(nt, { options: e, onClose: a, Component: o })
725
+ ), a;
1369
726
  }
1370
- function Qt() {
1371
- oe.cleanupAll();
727
+ function lt() {
728
+ j.cleanupAll();
1372
729
  }
1373
- function Zt() {
1374
- return oe.count;
730
+ function st() {
731
+ return j.count;
1375
732
  }
1376
- function en(r, t, o, i) {
1377
- it[r](t, o, i);
733
+ function it(e, t, r, n) {
734
+ ve[e](t, r, n);
1378
735
  }
1379
- const mn = {
1380
- showDrawer: Gt,
1381
- showModal: Xt,
1382
- cleanupAllDrawers: Qt,
1383
- getDrawerCount: Zt,
1384
- msg: en
1385
- }, $e = { module: "Module1" }, br = { router: void 0 }, yn = (r) => {
1386
- $e.module = r;
1387
- }, hn = (r) => {
1388
- br.router = r;
1389
- }, rn = (r, t, o) => {
1390
- o ? o($e.module).then((i) => {
1391
- typeof i[r] == "function" ? i[r](t) : console.error(
1392
- `Action "${r}" does not exist on the module.`
736
+ const _t = {
737
+ showDrawer: ot,
738
+ showModal: at,
739
+ cleanupAllDrawers: lt,
740
+ getDrawerCount: st,
741
+ msg: it
742
+ }, U = { module: "Module1" }, le = { router: void 0 }, $t = (e) => {
743
+ U.module = e;
744
+ }, Pt = (e) => {
745
+ le.router = e;
746
+ }, ct = (e, t, r) => {
747
+ r ? r(U.module).then((n) => {
748
+ typeof n[e] == "function" ? n[e](t) : console.error(
749
+ `Action "${e}" does not exist on the module.`
1393
750
  );
1394
- }).catch((i) => {
1395
- console.error(`Failed to execute action:${r}`, i);
751
+ }).catch((n) => {
752
+ console.error(`Failed to execute action:${e}`, n);
1396
753
  }) : console.warn(
1397
754
  "Module loader not configured. Please provide moduleLoader in initRuntime options."
1398
755
  );
1399
- }, gn = (r) => {
1400
- const { sessionId: t = "default", utils: o, moduleLoader: i } = r || {}, l = B();
1401
- let s = 0;
1402
- return F.subscribe((v) => {
1403
- const f = v.commandQueues[t] ?? [];
1404
- if (f.length <= s) {
1405
- s = f.length;
756
+ }, St = (e) => {
757
+ const { sessionId: t = "default", utils: r, moduleLoader: n } = e || {}, a = x();
758
+ let o = 0;
759
+ return v.subscribe((i) => {
760
+ const d = i.commandQueues[t] ?? [];
761
+ if (d.length <= o) {
762
+ o = d.length;
1406
763
  return;
1407
764
  }
1408
- const x = f[f.length - 1];
1409
- !x || typeof x.actionName != "string" || (s = f.length, F.getState().popCommand(t), rn(
1410
- x.actionName,
765
+ const p = d[d.length - 1];
766
+ !p || typeof p.actionName != "string" || (o = d.length, v.getState().popCommand(t), ct(
767
+ p.actionName,
1411
768
  {
1412
- ...x.arg,
1413
- moduleName: $e.module,
769
+ ...p.arg,
770
+ moduleName: U.module,
1414
771
  ctx: {
1415
- utils: o,
1416
- useStoreByName: ot,
1417
- defHttp: l.request,
772
+ utils: r,
773
+ useStoreByName: me,
774
+ defHttp: a.request,
1418
775
  useValidateWatchStore: void 0,
1419
- router: br.router
776
+ router: le.router
1420
777
  }
1421
778
  },
1422
- i
779
+ n
1423
780
  ));
1424
781
  });
1425
782
  };
1426
- function bn(r) {
1427
- return r && typeof r == "object" ? Object.values(r).some(
783
+ function jt(e) {
784
+ return e && typeof e == "object" ? Object.values(e).some(
1428
785
  (t) => typeof t == "string" && t.trim().length > 0
1429
786
  ) : !1;
1430
787
  }
1431
- function _n(r, t) {
1432
- F.getState().addCommand(r, {
788
+ function Ot(e, t) {
789
+ v.getState().addCommand(e, {
1433
790
  ...t,
1434
791
  timestamp: Date.now()
1435
792
  });
1436
793
  }
1437
- function xn(r, t) {
1438
- return F.getState().getValidateResults(r, t) ?? {};
794
+ function Mt(e, t) {
795
+ return v.getState().getValidateResults(e, t) ?? {};
1439
796
  }
1440
797
  export {
1441
- pn as ActionExecutor,
1442
- cn as ComponentRegistry,
1443
- vn as DynamicContainer,
1444
- fn as RuntimeRenderer,
1445
- mn as UIUtils,
1446
- _n as addCommand,
1447
- Qt as cleanupAllDrawers,
1448
- Oe as getComponent,
1449
- Zt as getDrawerCount,
1450
- xn as getValidateResults,
1451
- gn as initRuntime,
1452
- en as msg,
1453
- Ft as parsePageConfig,
1454
- Mt as registerComponent,
1455
- hn as setRoute,
1456
- Gt as showDrawer,
1457
- Xt as showModal,
1458
- yn as useModule,
1459
- dn as useRuntimeStore,
1460
- bn as validateFailed
798
+ Ct as ActionExecutor,
799
+ gt as ComponentRegistry,
800
+ wt as DynamicContainer,
801
+ bt as RuntimeRenderer,
802
+ _t as UIUtils,
803
+ Ot as addCommand,
804
+ lt as cleanupAllDrawers,
805
+ Y as getComponent,
806
+ st as getDrawerCount,
807
+ Mt as getValidateResults,
808
+ St as initRuntime,
809
+ it as msg,
810
+ He as parsePageConfig,
811
+ Ue as registerComponent,
812
+ Pt as setRoute,
813
+ ot as showDrawer,
814
+ at as showModal,
815
+ $t as useModule,
816
+ xt as useRuntimeStore,
817
+ jt as validateFailed
1461
818
  };
1462
819
  //# sourceMappingURL=index.esm.js.map