x-runtime-lib 0.9.18 → 0.9.19

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.js CHANGED
@@ -673,15 +673,19 @@ function Rn(e) {
673
673
  return e.startsWith("ref_v") || e.startsWith("multiple_ref_v") || e.startsWith("slot_v") || e.startsWith("multiple_slot_v");
674
674
  }
675
675
  function zn(e, t, ...n) {
676
- let r = {};
677
- return e.forEach((e) => {
678
- In(e.key) ? e.group && e.children && (r[e.group] || (r[e.group] = []), r[e.group].push(...e.children.map((e) => t(e, ...n)))) : Fn(e.key) ? e.render && e.children && (r.default ||= [], r.default.push(...e.children.map((e) => t(e, ...n)))) : (r.default ||= [], r.default.push(t(e, ...n)));
676
+ let r = [];
677
+ return e?.forEach((e) => {
678
+ In(e.key) ? e.group === "default" && e.children && r.push(...e.children.map((e) => t(e, ...n))) : Fn(e.key) ? e.render && e.children && r.push(...e.children.map((e) => t(e, ...n))) : r.push(t(e, ...n));
679
679
  }), r;
680
680
  }
681
- function Bn(e) {
682
- let t = {};
683
- for (let n in e) e[n].length > 0 && (t[n] = () => e[n]);
684
- return t;
681
+ function Bn(e, t, ...n) {
682
+ let r = {};
683
+ e?.forEach((e) => {
684
+ In(e.key) ? e.group && e.children && (r[e.group] || (r[e.group] = []), r[e.group].push(...e.children.map((e) => t(e, ...n)))) : Fn(e.key) ? e.render && e.children && (r.default ||= [], r.default.push(...e.children.map((e) => t(e, ...n)))) : (r.default ||= [], r.default.push(t(e, ...n)));
685
+ });
686
+ let i = {};
687
+ for (let e in r) r[e].length > 0 && (i[e] = () => r[e]);
688
+ return i;
685
689
  }
686
690
  //#endregion
687
691
  //#region src/utils/sandbox.ts
@@ -2744,10 +2748,10 @@ function Br(e, t, n) {
2744
2748
  compId: t.compId
2745
2749
  });
2746
2750
  let a = {};
2747
- return !n.leaf && t.children && (a = zn(t.children, r)), T(n.comp, {
2751
+ return !n.leaf && t.children && (a = Bn(t.children, r)), T(n.comp, {
2748
2752
  key: t.id,
2749
2753
  ...i
2750
- }, Bn(a));
2754
+ }, a);
2751
2755
  }
2752
2756
  return { render: () => {
2753
2757
  let { i18n: i } = Ae;
@@ -4003,14 +4007,13 @@ var Ti = g, Ei = /* @__PURE__ */ w({
4003
4007
  compId: t.compId
4004
4008
  });
4005
4009
  let i = {};
4006
- return !n.leaf && t.children && (i = zn(t.children, o)), T(n.comp, {
4010
+ return !n.leaf && t.children && (i = Bn(t.children, o)), T(n.comp, {
4007
4011
  key: t.id,
4008
4012
  ...r
4009
- }, Bn(i));
4013
+ }, i);
4010
4014
  }, s = () => {
4011
- let t = {};
4012
- if (a.value && (t = zn(a.value.view.nodeLites, o)), e.subtype === "ui") return T("div", null, t);
4013
- if (e.subtype === "3d") return T("TresGroup", null, t);
4015
+ if (e.subtype === "ui") return T("div", null, zn(a.value?.view.nodeLites, o));
4016
+ if (e.subtype === "3d") return T("TresGroup", null, zn(a.value?.view.nodeLites, o));
4014
4017
  };
4015
4018
  return (e, t) => (O(), b(s));
4016
4019
  }
@@ -4160,14 +4163,13 @@ var Ti = g, Ei = /* @__PURE__ */ w({
4160
4163
  compId: t.compId
4161
4164
  });
4162
4165
  let i = {};
4163
- return !n.leaf && t.children && (i = zn(t.children, o)), T(n.comp, {
4166
+ return !n.leaf && t.children && (i = Bn(t.children, o)), T(n.comp, {
4164
4167
  key: t.id,
4165
4168
  ...r
4166
- }, Bn(i));
4169
+ }, i);
4167
4170
  }, s = () => {
4168
- let t = {};
4169
- if (a.value && (t = zn(a.value.view.nodeLites, o)), e.subtype === "ui") return T("div", null, t);
4170
- if (e.subtype === "3d") return T("TresGroup", null, t);
4171
+ if (e.subtype === "ui") return T("div", null, zn(a.value?.view.nodeLites, o));
4172
+ if (e.subtype === "3d") return T("TresGroup", null, zn(a.value?.view.nodeLites, o));
4171
4173
  };
4172
4174
  return (e, t) => (O(), b(s));
4173
4175
  }
@@ -4311,10 +4313,10 @@ var Ti = g, Ei = /* @__PURE__ */ w({
4311
4313
  compId: e.compId
4312
4314
  });
4313
4315
  let i = {};
4314
- return !t.leaf && e.children && (i = zn(e.children, m)), T(t.comp, {
4316
+ return !t.leaf && e.children && (i = Bn(e.children, m)), T(t.comp, {
4315
4317
  key: e.id,
4316
4318
  ...r
4317
- }, Bn(i));
4319
+ }, i);
4318
4320
  }, h = () => {
4319
4321
  if (!n.refContext) {
4320
4322
  console.assert(!1, "invalid ref context");
@@ -4348,17 +4350,16 @@ var Ti = g, Ei = /* @__PURE__ */ w({
4348
4350
  console.assert(!1, "subtype not match");
4349
4351
  return;
4350
4352
  }
4351
- let r = zn(s.value.view.nodeLites, m);
4352
4353
  if (s.value.type === "ui") return T("div", {
4353
4354
  id: t.id,
4354
4355
  style: u.value
4355
- }, r);
4356
+ }, zn(s.value.view.nodeLites, m));
4356
4357
  if (s.value.type === "3d") return T(ji, {
4357
4358
  name: t.name,
4358
4359
  position: d.value,
4359
4360
  rotation: f.value,
4360
4361
  scale: p.value
4361
- }, r);
4362
+ }, zn(s.value.view.nodeLites, m));
4362
4363
  };
4363
4364
  return (e, t) => (O(), b(h));
4364
4365
  }
@@ -4416,10 +4417,10 @@ var Vi = /* @__PURE__ */ si(zi, [["render", Bi]]), Hi = /* @__PURE__ */ w({
4416
4417
  compId: e.compId
4417
4418
  });
4418
4419
  let i = {};
4419
- return !t.leaf && e.children && (i = zn(e.children, p)), T(t.comp, {
4420
+ return !t.leaf && e.children && (i = Bn(e.children, p)), T(t.comp, {
4420
4421
  key: e.id,
4421
4422
  ...r
4422
- }, Bn(i));
4423
+ }, i);
4423
4424
  }
4424
4425
  let m = () => {
4425
4426
  if (!n.refContext) {
@@ -4454,17 +4455,16 @@ var Vi = /* @__PURE__ */ si(zi, [["render", Bi]]), Hi = /* @__PURE__ */ w({
4454
4455
  console.assert(!1, "subtype not match");
4455
4456
  return;
4456
4457
  }
4457
- let r = zn(s.value.view.nodeLites, p);
4458
4458
  if (s.value.type === "ui") return T("div", {
4459
4459
  id: t.id,
4460
4460
  style: l.value
4461
- }, r);
4461
+ }, zn(s.value.view.nodeLites, p));
4462
4462
  if (s.value.type === "3d") return T(ji, {
4463
4463
  name: t.name,
4464
4464
  position: u.value,
4465
4465
  rotation: d.value,
4466
4466
  scale: f.value
4467
- }, r);
4467
+ }, zn(s.value.view.nodeLites, p));
4468
4468
  };
4469
4469
  return (e, t) => (O(), b(m));
4470
4470
  }
@@ -12987,4 +12987,4 @@ async function Bl(e) {
12987
12987
  }), `./locales/${e}/index.ts`, 4)).default;
12988
12988
  }
12989
12989
  //#endregion
12990
- export { dt as addIndent, We as breakpoints, qe as calcBreakpoint, _t as compTypes, Xe as createBreakpointProperty, R as createMakeNode, Vt as createNode, Pt as dataStringify, Wt as duplicateNodePair, Gt as duplicateNodePairs, yt as elementKeys, bl as finalProperties, ct as fromDotString, Qe as genId, xt as getAllElements, Ke as getBreakpointName, Ye as getBreakpointProperty, St as getElement, lt as getField, Vn as getImplementMethodName, Je as getIndexOfBreakpoint, Tt as getItems, Ht as getNodeLite, zt as getPropertyDefault, Rt as getPropertyDefaultArray, ot as getRadius, vt as getTag, kt as getTypes, Rn as hasComp, Ln as hasSlot, Bt as initProperties, Pn as injectActivatorContext, _n as injectDark, Cn as injectData, Tn as injectDepends, hn as injectDevice, fn as injectEnv, yn as injectId, Sn as injectMeta, z as injectMode, Mn as injectNode, An as injectNodeLite, un as injectOrg, Dn as injectRuntime, H as injectSandbox, xn as injectType, jt as isCircularReference, At as isExecutableMode, rt as isHexColor, tt as isPercent, $e as isPixel, In as isRenderGroup, Fn as isRenderSwitch, at as isThemeColor, Ct as itemsKeys, Bl as loadLocaleMessageRuntime, U as makeEventId, rr as makeEventKeyOfCustomSlot, tr as makeEventKeyOfElementSlot, Jn as makeMethodId, Qn as makeMethodKeyOfCustomSlot, Xn as makeMethodKeyOfElementSlot, Ut as makeNodePair, Hn as makePropertyId, Kn as makePropertyKeyOfCustomSlot, Wn as makePropertyKeyOfElementSlot, ar as makeSlotId, sr as makeTriggerId, It as metaStringify, gt as pageTypes, Ft as parseData, Lt as parseMeta, nt as parsePercent, et as parsePixel, Tr as pkgs, Nn as provideActivatorContext, gn as provideDark, V as provideData, wn as provideDepends, mn as provideDevice, dn as provideEnv, vn as provideId, B as provideMeta, pn as provideMode, jn as provideNode, kn as provideNodeLite, ln as provideOrg, En as provideRuntime, On as provideSandbox, bn as provideType, I as regElement, L as regItems, Ot as regTypes, Ge as reverseBreakpoints, ut as setField, Mt as syncNodeLite, it as themeColors, st as toDotString, ht as toEventName, mt as toMethodName, Nt as toNodeLite, pt as toPropertyName, zn as toRenderGroups, Bn as toRenderSlots, Et as typesKeys, er as unwrapEventId, ir as unwrapEventKeyOfCustomSlot, nr as unwrapEventKeyOfElementSlot, Yn as unwrapMethodId, $n as unwrapMethodKeyOfCustomSlot, Zn as unwrapMethodKeyOfElementSlot, Un as unwrapPropertyId, qn as unwrapPropertyKeyOfCustomSlot, Gn as unwrapPropertyKeyOfElementSlot, or as unwrapSlotId, cr as unwrapTriggerId, lr as useColor, W as useDepend, ur as useRuntime, Rl as useSandbox, $ as useTheme };
12990
+ export { dt as addIndent, We as breakpoints, qe as calcBreakpoint, _t as compTypes, Xe as createBreakpointProperty, R as createMakeNode, Vt as createNode, Pt as dataStringify, Wt as duplicateNodePair, Gt as duplicateNodePairs, yt as elementKeys, bl as finalProperties, ct as fromDotString, Qe as genId, xt as getAllElements, Ke as getBreakpointName, Ye as getBreakpointProperty, St as getElement, lt as getField, Vn as getImplementMethodName, Je as getIndexOfBreakpoint, Tt as getItems, Ht as getNodeLite, zt as getPropertyDefault, Rt as getPropertyDefaultArray, ot as getRadius, vt as getTag, kt as getTypes, Rn as hasComp, Ln as hasSlot, Bt as initProperties, Pn as injectActivatorContext, _n as injectDark, Cn as injectData, Tn as injectDepends, hn as injectDevice, fn as injectEnv, yn as injectId, Sn as injectMeta, z as injectMode, Mn as injectNode, An as injectNodeLite, un as injectOrg, Dn as injectRuntime, H as injectSandbox, xn as injectType, jt as isCircularReference, At as isExecutableMode, rt as isHexColor, tt as isPercent, $e as isPixel, In as isRenderGroup, Fn as isRenderSwitch, at as isThemeColor, Ct as itemsKeys, Bl as loadLocaleMessageRuntime, U as makeEventId, rr as makeEventKeyOfCustomSlot, tr as makeEventKeyOfElementSlot, Jn as makeMethodId, Qn as makeMethodKeyOfCustomSlot, Xn as makeMethodKeyOfElementSlot, Ut as makeNodePair, Hn as makePropertyId, Kn as makePropertyKeyOfCustomSlot, Wn as makePropertyKeyOfElementSlot, ar as makeSlotId, sr as makeTriggerId, It as metaStringify, gt as pageTypes, Ft as parseData, Lt as parseMeta, nt as parsePercent, et as parsePixel, Tr as pkgs, Nn as provideActivatorContext, gn as provideDark, V as provideData, wn as provideDepends, mn as provideDevice, dn as provideEnv, vn as provideId, B as provideMeta, pn as provideMode, jn as provideNode, kn as provideNodeLite, ln as provideOrg, En as provideRuntime, On as provideSandbox, bn as provideType, I as regElement, L as regItems, Ot as regTypes, Ge as reverseBreakpoints, ut as setField, Mt as syncNodeLite, it as themeColors, st as toDotString, ht as toEventName, mt as toMethodName, Nt as toNodeLite, pt as toPropertyName, zn as toRenderDefault, Bn as toRenderSlots, Et as typesKeys, er as unwrapEventId, ir as unwrapEventKeyOfCustomSlot, nr as unwrapEventKeyOfElementSlot, Yn as unwrapMethodId, $n as unwrapMethodKeyOfCustomSlot, Zn as unwrapMethodKeyOfElementSlot, Un as unwrapPropertyId, qn as unwrapPropertyKeyOfCustomSlot, Gn as unwrapPropertyKeyOfElementSlot, or as unwrapSlotId, cr as unwrapTriggerId, lr as useColor, W as useDepend, ur as useRuntime, Rl as useSandbox, $ as useTheme };
@@ -3,11 +3,7 @@ export declare function isRenderSwitch(key: string): boolean;
3
3
  export declare function isRenderGroup(key: string): boolean;
4
4
  export declare function hasSlot(key: string): boolean;
5
5
  export declare function hasComp(key: string): boolean;
6
- export declare function toRenderGroups(children: NodeLite[], renderNode: (n: NodeLite, ...params: any[]) => any, ...params: any[]): {
7
- [key: string]: any[];
8
- };
9
- export declare function toRenderSlots(groups: {
10
- [key: string]: any[];
11
- }): {
6
+ export declare function toRenderDefault(children: NodeLite[] | undefined, renderNode: (n: NodeLite, ...params: any[]) => any, ...params: any[]): any[];
7
+ export declare function toRenderSlots(children: NodeLite[] | undefined, renderNode: (n: NodeLite, ...params: any[]) => any, ...params: any[]): {
12
8
  [key: string]: any;
13
9
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.9.18",
4
+ "version": "0.9.19",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",