@inf-monkeys-tech/monkeys-design 1.0.7 → 1.0.8

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.
@@ -2661,6 +2661,9 @@ function RenderTreeHost({
2661
2661
  activeNodeIds,
2662
2662
  visibleNodeIds,
2663
2663
  manualQueryNodeIds,
2664
+ loading,
2665
+ empty,
2666
+ error,
2664
2667
  elementForNode = defaultElementForNode,
2665
2668
  classNameForNode,
2666
2669
  elementRefForNode,
@@ -2672,7 +2675,11 @@ function RenderTreeHost({
2672
2675
  }) {
2673
2676
  const compiled = useMemo(() => compileRenderTree(tree), [tree]);
2674
2677
  const renderBranch = (node) => {
2675
- const descendants = compiled.childrenOf(node.nodeId).map((child) => /* @__PURE__ */ jsx(Fragment$1, { children: renderBranch(child) }, child.nodeId));
2678
+ const childNodes = compiled.childrenOf(node.nodeId);
2679
+ const descendants = childNodes.map((child) => /* @__PURE__ */ jsx(Fragment$1, { children: renderBranch(child) }, child.nodeId));
2680
+ const childrenBySlot = Object.freeze(Object.fromEntries(
2681
+ childNodes.map((child, index) => [child.slot ?? child.nodeId, descendants[index]])
2682
+ ));
2676
2683
  return /* @__PURE__ */ jsx(
2677
2684
  RenderNodeHost,
2678
2685
  {
@@ -2681,13 +2688,22 @@ function RenderTreeHost({
2681
2688
  active: activeNodeIds?.has(node.nodeId) ?? true,
2682
2689
  visible: visibleNodeIds?.has(node.nodeId) ?? true,
2683
2690
  manualQueryEnabled: manualQueryNodeIds?.has(node.nodeId) ?? false,
2691
+ loading,
2692
+ empty,
2693
+ error,
2684
2694
  className: classNameForNode?.(node),
2685
2695
  elementRef: elementRefForNode?.(node),
2686
2696
  scrollRestoration,
2687
2697
  onActivate,
2688
2698
  onManualQueryEnabledChange,
2689
2699
  onRuntimeStateChange,
2690
- children: (runtime) => renderNode?.({ ...runtime, node, children: descendants }) ?? descendants
2700
+ children: (runtime) => renderNode?.({
2701
+ ...runtime,
2702
+ node,
2703
+ children: descendants,
2704
+ childNodes,
2705
+ childrenBySlot
2706
+ }) ?? descendants
2691
2707
  },
2692
2708
  node.nodeId
2693
2709
  );
@@ -2844,7 +2860,38 @@ function RenderTreeRuntimeHost({
2844
2860
  }
2845
2861
  );
2846
2862
  }
2863
+ var defaultResolveBinding = (node, bindings) => {
2864
+ const bindingId = node.dataContextRef?.id;
2865
+ return bindingId ? bindings[bindingId] : void 0;
2866
+ };
2867
+ function RenderTreeRegistryHost({
2868
+ tree,
2869
+ components,
2870
+ bindings = {},
2871
+ resolveBinding = defaultResolveBinding,
2872
+ renderMissingComponent,
2873
+ ...props
2874
+ }) {
2875
+ return /* @__PURE__ */ jsx(
2876
+ RenderTreeRuntimeHost,
2877
+ {
2878
+ ...props,
2879
+ tree,
2880
+ renderNode: (context) => {
2881
+ const renderer = components[context.node.capabilityRef.id];
2882
+ if (!renderer) {
2883
+ return renderMissingComponent?.(context) ?? context.children;
2884
+ }
2885
+ return renderer({
2886
+ ...context,
2887
+ binding: resolveBinding(context.node, bindings),
2888
+ model: context.node.renderModel
2889
+ });
2890
+ }
2891
+ }
2892
+ );
2893
+ }
2847
2894
 
2848
- export { ApplicationHandoffLink, OverlayNodeHost, RenderNodeHost, RenderTreeHost, RenderTreeRuntimeHost, browserOverlayHistoryAdapter, browserRenderTreeHistoryAdapter, buildOverlayUrl, getOverlayPresentationClassNames, getOverlayZIndex, getRenderNodeDataAttributes, isOverlayUrlActive, resolveRenderNodePolicyState, sessionRenderNodeScrollRestoration };
2895
+ export { ApplicationHandoffLink, OverlayNodeHost, RenderNodeHost, RenderTreeHost, RenderTreeRegistryHost, RenderTreeRuntimeHost, browserOverlayHistoryAdapter, browserRenderTreeHistoryAdapter, buildOverlayUrl, getOverlayPresentationClassNames, getOverlayZIndex, getRenderNodeDataAttributes, isOverlayUrlActive, resolveRenderNodePolicyState, sessionRenderNodeScrollRestoration };
2849
2896
  //# sourceMappingURL=index.mjs.map
2850
2897
  //# sourceMappingURL=index.mjs.map