@chamn/render 0.0.34 → 0.0.35

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.mjs CHANGED
@@ -3263,7 +3263,7 @@ function Xo(t, e, r, n, o) {
3263
3263
  var fm = Jp(function(t, e, r) {
3264
3264
  Xo(t, e, r);
3265
3265
  });
3266
- const pm = fm, Zm = function(t) {
3266
+ const pm = fm, tv = function(t) {
3267
3267
  return !(!t || typeof t != "function" || !t.prototype);
3268
3268
  };
3269
3269
  function dm(t) {
@@ -3329,20 +3329,20 @@ return $$_run_$$();
3329
3329
  let a = o.split("-");
3330
3330
  a.length >= 2 && (a = a.map((i, s) => s !== 0 ? Jh(i) : i)), e[a.join("")] = n;
3331
3331
  }), e;
3332
- }, tv = (t) => {
3332
+ }, ev = (t) => {
3333
3333
  let e = "";
3334
3334
  return Object.keys(t || {}).forEach((r) => {
3335
3335
  e += `${r}:${t[r]};`;
3336
3336
  }), e;
3337
- }, ev = (t, e) => {
3337
+ }, rv = (t, e) => {
3338
3338
  const r = {};
3339
3339
  return t.forEach((n) => {
3340
3340
  if (n.globalName) {
3341
3341
  const o = e[n.globalName];
3342
- o && (r[n.globalName] = o);
3342
+ o && (r[n.globalName] = o, o.__esModule && (r[n.globalName] = o.__esModule));
3343
3343
  }
3344
3344
  }), r;
3345
- }, rv = (t, e = 1) => {
3345
+ }, nv = (t, e = 1) => {
3346
3346
  let r = 0, n = t, o = {}, a = {};
3347
3347
  for (; r < e; )
3348
3348
  Object.keys(n).forEach((i) => {
@@ -3363,10 +3363,16 @@ return $$_run_$$();
3363
3363
  return e.forEach((n) => {
3364
3364
  t[n.name] && (r[n.name] = t[n.name]);
3365
3365
  }), r;
3366
- }, nv = (t, e) => Zo(t, e), ov = (t, e) => Zo(t, e), Be = (t) => {
3366
+ }, ov = (t, e) => Zo(t, e), av = (t, e) => Zo(t, e), Be = (t) => {
3367
3367
  var r;
3368
3368
  return ((r = t.value.css) == null ? void 0 : r.class) || `c_${t.id}`;
3369
- }, ue = "DYNAMIC", ym = ["$$context", "$$nodeModel"], In = (t) => {
3369
+ }, ym = (t, e) => {
3370
+ const r = t.split(".");
3371
+ let n, o = e;
3372
+ return r.forEach((a) => {
3373
+ n = o == null ? void 0 : o[a], o = n;
3374
+ }), n || (() => `Component [${t}] not found`);
3375
+ }, ue = "DYNAMIC", bm = ["$$context", "$$nodeModel"], In = (t) => {
3370
3376
  let e;
3371
3377
  const r = /* @__PURE__ */ new Set(), n = (c, u) => {
3372
3378
  const l = typeof c == "function" ? c(e) : c;
@@ -3380,13 +3386,13 @@ return $$_run_$$();
3380
3386
  ), r.clear();
3381
3387
  } };
3382
3388
  return e = t(n, o, s), s;
3383
- }, bm = (t) => t ? In(t) : In;
3384
- class _m {
3389
+ }, _m = (t) => t ? In(t) : In;
3390
+ class Sm {
3385
3391
  constructor() {
3386
3392
  y(this, "storeMap", /* @__PURE__ */ new Map());
3387
3393
  }
3388
3394
  addStore(e, r) {
3389
- const n = bm(r);
3395
+ const n = _m(r);
3390
3396
  return this.storeMap.set(e, n), n.name = e, n;
3391
3397
  }
3392
3398
  setStore(e, r) {
@@ -3430,7 +3436,7 @@ class _m {
3430
3436
  this.storeMap = /* @__PURE__ */ new Map();
3431
3437
  }
3432
3438
  }
3433
- class Sm {
3439
+ class jm {
3434
3440
  constructor() {
3435
3441
  y(this, "varSpace", /* @__PURE__ */ new Map());
3436
3442
  }
@@ -3453,13 +3459,13 @@ class Sm {
3453
3459
  }), e;
3454
3460
  }
3455
3461
  }
3456
- class jm {
3462
+ class Om {
3457
3463
  constructor() {
3458
3464
  y(this, "renderMode", "normal");
3459
3465
  y(this, "components", {});
3460
- y(this, "storeManager", new _m());
3466
+ y(this, "storeManager", new Sm());
3461
3467
  // 存储节点的变量或者方法
3462
- y(this, "variableManager", new Sm());
3468
+ y(this, "variableManager", new jm());
3463
3469
  y(this, "runtimeComponentCache", /* @__PURE__ */ new Map());
3464
3470
  y(this, "onGetRef");
3465
3471
  y(this, "onGetComponent");
@@ -3471,7 +3477,7 @@ class jm {
3471
3477
  getComponent(e) {
3472
3478
  var o;
3473
3479
  const r = e.value.componentName;
3474
- let n = this.components[r] || (() => `Component [${r}] not found`);
3480
+ let n = ym(r, this.components);
3475
3481
  return hm(n) || (n = mm(n), this.components[r] = n), this.onGetComponent && (n = (o = this.onGetComponent) == null ? void 0 : o.call(this, n, e)), n;
3476
3482
  }
3477
3483
  getContext(e = {}, r) {
@@ -3877,7 +3883,7 @@ class jm {
3877
3883
  }
3878
3884
  // 真实渲染
3879
3885
  render(e, r = {}, ...n) {
3880
- return typeof e == "string" || typeof e == "number" ? String(e) : (ym.forEach((a) => {
3886
+ return typeof e == "string" || typeof e == "number" ? String(e) : (bm.forEach((a) => {
3881
3887
  a in r && e.__CP_TYPE__ !== ue && delete r[a];
3882
3888
  }), O.createElement(e, r, ...n));
3883
3889
  }
@@ -3885,7 +3891,7 @@ class jm {
3885
3891
  this.runtimeComponentCache.clear(), this.storeManager.destroy();
3886
3892
  }
3887
3893
  }
3888
- const av = va(new jm()), Om = [
3894
+ const sv = va(new Om()), wm = [
3889
3895
  "a",
3890
3896
  "abbr",
3891
3897
  "acronym",
@@ -4035,8 +4041,8 @@ const av = va(new jm()), Om = [
4035
4041
  "wbr",
4036
4042
  "xmp"
4037
4043
  ];
4038
- var wm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4039
- function Cm(t) {
4044
+ var Cm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4045
+ function Em(t) {
4040
4046
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
4041
4047
  }
4042
4048
  var ta = { exports: {} }, Ce = {};
@@ -4049,28 +4055,28 @@ var ta = { exports: {} }, Ce = {};
4049
4055
  * This source code is licensed under the MIT license found in the
4050
4056
  * LICENSE file in the root directory of this source tree.
4051
4057
  */
4052
- var Em = O, $m = Symbol.for("react.element"), Nm = Symbol.for("react.fragment"), xm = Object.prototype.hasOwnProperty, Tm = Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Mm = { key: !0, ref: !0, __self: !0, __source: !0 };
4058
+ var $m = O, Nm = Symbol.for("react.element"), xm = Symbol.for("react.fragment"), Tm = Object.prototype.hasOwnProperty, Mm = $m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Am = { key: !0, ref: !0, __self: !0, __source: !0 };
4053
4059
  function ea(t, e, r) {
4054
4060
  var n, o = {}, a = null, i = null;
4055
4061
  r !== void 0 && (a = "" + r), e.key !== void 0 && (a = "" + e.key), e.ref !== void 0 && (i = e.ref);
4056
4062
  for (n in e)
4057
- xm.call(e, n) && !Mm.hasOwnProperty(n) && (o[n] = e[n]);
4063
+ Tm.call(e, n) && !Am.hasOwnProperty(n) && (o[n] = e[n]);
4058
4064
  if (t && t.defaultProps)
4059
4065
  for (n in e = t.defaultProps, e)
4060
4066
  o[n] === void 0 && (o[n] = e[n]);
4061
- return { $$typeof: $m, type: t, key: a, ref: i, props: o, _owner: Tm.current };
4067
+ return { $$typeof: Nm, type: t, key: a, ref: i, props: o, _owner: Mm.current };
4062
4068
  }
4063
- Ce.Fragment = Nm;
4069
+ Ce.Fragment = xm;
4064
4070
  Ce.jsx = ea;
4065
4071
  Ce.jsxs = ea;
4066
4072
  ta.exports = Ce;
4067
- var Am = ta.exports;
4068
- const Pm = Am.jsx, nt = (t) => {
4073
+ var Pm = ta.exports;
4074
+ const Rm = Pm.jsx, nt = (t) => {
4069
4075
  const e = {};
4070
4076
  return t.forEach((r) => {
4071
4077
  e[r.key] = r.value;
4072
4078
  }), e;
4073
- }, Rm = [...Om, ...bf], Im = Rm.reduce((t, e) => (t[e] = ({
4079
+ }, Im = [...wm, ...bf], Dm = Im.reduce((t, e) => (t[e] = ({
4074
4080
  children: r,
4075
4081
  $$attributes: n = [],
4076
4082
  ...o
@@ -4080,7 +4086,7 @@ const Pm = Am.jsx, nt = (t) => {
4080
4086
  ...o,
4081
4087
  ...nt(n)
4082
4088
  }, ...a);
4083
- }, t), {}), Dm = ({
4089
+ }, t), {}), Lm = ({
4084
4090
  children: t,
4085
4091
  width: e,
4086
4092
  height: r,
@@ -4103,7 +4109,7 @@ const Pm = Am.jsx, nt = (t) => {
4103
4109
  ...s,
4104
4110
  style: c
4105
4111
  }, ...a);
4106
- }, Lm = ({
4112
+ }, Bm = ({
4107
4113
  afterMount: t,
4108
4114
  beforeDestroy: e,
4109
4115
  $$attributes: r = [],
@@ -4113,7 +4119,7 @@ const Pm = Am.jsx, nt = (t) => {
4113
4119
  }), []), O.createElement("canvas", {
4114
4120
  ...n,
4115
4121
  ...nt(r)
4116
- })), Bm = ({
4122
+ })), Fm = ({
4117
4123
  children: t,
4118
4124
  $$attributes: e = [],
4119
4125
  ...r
@@ -4123,7 +4129,7 @@ const Pm = Am.jsx, nt = (t) => {
4123
4129
  ...r,
4124
4130
  ...nt(e)
4125
4131
  }, ...n);
4126
- }, Fm = ({
4132
+ }, Um = ({
4127
4133
  children: t,
4128
4134
  $$attributes: e = [],
4129
4135
  ...r
@@ -4133,7 +4139,7 @@ const Pm = Am.jsx, nt = (t) => {
4133
4139
  ...r,
4134
4140
  ...nt(e)
4135
4141
  }, ...n);
4136
- }, Um = ({
4142
+ }, km = ({
4137
4143
  children: t,
4138
4144
  $$attributes: e = [],
4139
4145
  ...r
@@ -4143,14 +4149,14 @@ const Pm = Am.jsx, nt = (t) => {
4143
4149
  ...r,
4144
4150
  ...nt(e)
4145
4151
  }, ...n);
4146
- }, km = ({
4152
+ }, Vm = ({
4147
4153
  $$attributes: t = [],
4148
4154
  content: e,
4149
4155
  ...r
4150
4156
  }) => O.createElement("span", {
4151
4157
  ...r,
4152
4158
  ...nt(t)
4153
- }, e), Vm = ({
4159
+ }, e), Gm = ({
4154
4160
  children: t,
4155
4161
  $$attributes: e = [],
4156
4162
  afterMount: r,
@@ -4160,12 +4166,12 @@ const Pm = Am.jsx, nt = (t) => {
4160
4166
  let a = t;
4161
4167
  return Array.isArray(t) || (a = [t]), Ln(() => (r == null || r(o), () => {
4162
4168
  n == null || n(o);
4163
- }), []), /* @__PURE__ */ Pm("div", {
4169
+ }), []), /* @__PURE__ */ Rm("div", {
4164
4170
  ...o,
4165
4171
  ...nt(e),
4166
4172
  children: a
4167
4173
  });
4168
- }, Gm = ({
4174
+ }, zm = ({
4169
4175
  children: t,
4170
4176
  $$attributes: e = [],
4171
4177
  htmlTag: r = "div",
@@ -4185,21 +4191,21 @@ const Pm = Am.jsx, nt = (t) => {
4185
4191
  ...i,
4186
4192
  style: s
4187
4193
  }, ...o);
4188
- }, zm = {
4194
+ }, Hm = {
4189
4195
  RootContainer: ({
4190
4196
  children: t
4191
4197
  }) => t,
4192
- ...Im,
4193
- CContainer: Vm,
4194
- CVideo: Fm,
4195
- CAudio: Um,
4196
- CBlock: Dm,
4197
- CImage: Bm,
4198
- CText: km,
4199
- CCanvas: Lm,
4200
- CNativeTag: Gm
4198
+ ...Dm,
4199
+ CContainer: Gm,
4200
+ CVideo: Um,
4201
+ CAudio: km,
4202
+ CBlock: Lm,
4203
+ CImage: Fm,
4204
+ CText: Vm,
4205
+ CCanvas: Bm,
4206
+ CNativeTag: zm
4201
4207
  };
4202
- class Hm {
4208
+ class Jm {
4203
4209
  constructor() {
4204
4210
  y(this, "refMap", /* @__PURE__ */ new Map());
4205
4211
  }
@@ -4216,7 +4222,7 @@ class Hm {
4216
4222
  this.refMap.clear();
4217
4223
  }
4218
4224
  }
4219
- class Jm extends O.Component {
4225
+ class Wm extends O.Component {
4220
4226
  constructor(r) {
4221
4227
  super(r);
4222
4228
  y(this, "refManager");
@@ -4242,7 +4248,7 @@ class Jm extends O.Component {
4242
4248
  });
4243
4249
  this.state = {
4244
4250
  pageModel: r.pageModel || new de(r.page)
4245
- }, this.refManager = new Hm();
4251
+ }, this.refManager = new Jm();
4246
4252
  }
4247
4253
  getPageModel() {
4248
4254
  return this.state.pageModel;
@@ -4259,7 +4265,7 @@ class Jm extends O.Component {
4259
4265
  if (!s)
4260
4266
  return console.warn("pageModel is null"), null;
4261
4267
  const c = {
4262
- ...zm,
4268
+ ...Hm,
4263
4269
  ...r.components
4264
4270
  }, u = this.props.$$context ?? {};
4265
4271
  return u.refs = this.refManager, n.pageRender(s, {
@@ -4275,7 +4281,7 @@ class Jm extends O.Component {
4275
4281
  });
4276
4282
  }
4277
4283
  }
4278
- const sv = () => {
4284
+ const iv = () => {
4279
4285
  const t = Bn(null);
4280
4286
  return {
4281
4287
  ref: t,
@@ -4284,7 +4290,7 @@ const sv = () => {
4284
4290
  }
4285
4291
  };
4286
4292
  };
4287
- class Wm extends O.Component {
4293
+ class Qm extends O.Component {
4288
4294
  constructor(r) {
4289
4295
  super(r);
4290
4296
  y(this, "onDoubleClick", () => {
@@ -4351,7 +4357,7 @@ class Wm extends O.Component {
4351
4357
  return this.props.children;
4352
4358
  }
4353
4359
  }
4354
- class Qm {
4360
+ class qm {
4355
4361
  constructor() {
4356
4362
  y(this, "instanceMap", /* @__PURE__ */ new Map());
4357
4363
  }
@@ -4374,7 +4380,7 @@ class Qm {
4374
4380
  this.instanceMap.clear();
4375
4381
  }
4376
4382
  }
4377
- const qm = (t) => {
4383
+ const Ym = (t) => {
4378
4384
  const { node: e } = t, r = pa(() => {
4379
4385
  const s = e.isContainer();
4380
4386
  return $t(s) ? s : {
@@ -4407,12 +4413,12 @@ const qm = (t) => {
4407
4413
  n
4408
4414
  );
4409
4415
  };
4410
- class iv extends O.Component {
4416
+ class cv extends O.Component {
4411
4417
  constructor(r) {
4412
4418
  super(r);
4413
- y(this, "instanceManager", new Qm());
4419
+ y(this, "instanceManager", new qm());
4414
4420
  y(this, "renderRef");
4415
- y(this, "dropPlaceholder", qm);
4421
+ y(this, "dropPlaceholder", Ym);
4416
4422
  y(this, "_components", {});
4417
4423
  y(this, "onGetComponent", (r, n) => {
4418
4424
  var c, u;
@@ -4455,7 +4461,7 @@ class iv extends O.Component {
4455
4461
  }
4456
4462
  return O.forwardRef(function(p, f) {
4457
4463
  return O.createElement(
4458
- Wm,
4464
+ Qm,
4459
4465
  {
4460
4466
  node: n,
4461
4467
  targetComponent: s
@@ -4515,7 +4521,7 @@ class iv extends O.Component {
4515
4521
  }
4516
4522
  render() {
4517
4523
  const { props: r, onGetComponent: n } = this, { render: o, ...a } = r;
4518
- return o && (o.ref.current = this), O.createElement(Jm, {
4524
+ return o && (o.ref.current = this), O.createElement(Wm, {
4519
4525
  onGetComponent: n,
4520
4526
  ...a,
4521
4527
  components: this._components,
@@ -4560,7 +4566,7 @@ const ra = (t) => {
4560
4566
  }, na = (t) => {
4561
4567
  var e;
4562
4568
  return t ? (e = t == null ? void 0 : t.stateNode) != null && e._DESIGN_BOX ? t : na(t.return) : null;
4563
- }, cv = () => {
4569
+ }, uv = () => {
4564
4570
  const t = Bn(null);
4565
4571
  return {
4566
4572
  ref: t,
@@ -4589,7 +4595,7 @@ var oa = { exports: {} };
4589
4595
  (function(t, e) {
4590
4596
  (function(r, n) {
4591
4597
  t.exports = n();
4592
- })(wm, function() {
4598
+ })(Cm, function() {
4593
4599
  var r = function() {
4594
4600
  }, n = {}, o = {}, a = {};
4595
4601
  function i(f, d) {
@@ -4686,9 +4692,9 @@ var oa = { exports: {} };
4686
4692
  }, p;
4687
4693
  });
4688
4694
  })(oa);
4689
- var Ym = oa.exports;
4690
- const Dn = /* @__PURE__ */ Cm(Ym);
4691
- class uv {
4695
+ var Km = oa.exports;
4696
+ const Dn = /* @__PURE__ */ Em(Km);
4697
+ class lv {
4692
4698
  constructor(e, r) {
4693
4699
  y(this, "assets");
4694
4700
  y(this, "loadStatus");
@@ -4731,30 +4737,31 @@ class uv {
4731
4737
  }
4732
4738
  }
4733
4739
  export {
4734
- uv as AssetLoader,
4735
- Qm as ComponentInstanceManager,
4736
- qm as DefaultDropPlaceholder,
4737
- jm as DefineReactAdapter,
4738
- iv as DesignRender,
4739
- av as ReactAdapter,
4740
- Jm as Render,
4740
+ lv as AssetLoader,
4741
+ qm as ComponentInstanceManager,
4742
+ Ym as DefaultDropPlaceholder,
4743
+ Om as DefineReactAdapter,
4744
+ cv as DesignRender,
4745
+ sv as ReactAdapter,
4746
+ Wm as Render,
4741
4747
  hm as canAcceptsRef,
4742
- ev as collectVariable,
4748
+ rv as collectVariable,
4743
4749
  mm as compWrapper,
4744
4750
  vm as convertCodeStringToFunction,
4745
- rv as flatObject,
4751
+ ym as findComponentByChainRefer,
4752
+ nv as flatObject,
4746
4753
  Rn as formatSourceStylePropertyName,
4747
4754
  va as getAdapter,
4748
- tv as getCSSTextValue,
4749
- nv as getComponentsLibs,
4755
+ ev as getCSSTextValue,
4756
+ ov as getComponentsLibs,
4750
4757
  gm as getMatchVal,
4751
4758
  Be as getNodeCssClassName,
4752
4759
  Pn as getObjFromArrayMap,
4753
- ov as getThirdLibs,
4754
- Zm as isClass,
4760
+ av as getThirdLibs,
4761
+ tv as isClass,
4755
4762
  bt as runExpression,
4756
4763
  dm as shouldConstruct,
4757
- cv as useDesignRender,
4758
- sv as useRender
4764
+ uv as useDesignRender,
4765
+ iv as useRender
4759
4766
  };
4760
4767
  //# sourceMappingURL=index.mjs.map