@rulecms/widget-angular 0.3.0 → 0.4.0

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Input, Component, HostBinding, ErrorHandler, Optional, Inject } from '@angular/core';
3
- import { NgComponentOutlet, NgStyle } from '@angular/common';
3
+ import { NgComponentOutlet, NgStyle, NgTemplateOutlet } from '@angular/common';
4
4
 
5
5
  /**
6
6
  * The reserved id for the default component library. Configs that carry no
@@ -902,6 +902,12 @@ const overflowAllowlist = [
902
902
  'auto',
903
903
  'clip',
904
904
  ];
905
+ /**
906
+ * Whether an element takes pointer input. `none` passes clicks through to
907
+ * whatever sits behind, which is what an overlay layer covering the base needs;
908
+ * a descendant can take input back with `auto`, since the property inherits.
909
+ */
910
+ const pointerEventsAllowlist = ['auto', 'none'];
905
911
  /** Column flex layout — matches row Horizontal Alignment options. */
906
912
  const justifyContentAllowlist = [
907
913
  'flex-start',
@@ -1408,6 +1414,13 @@ const objectStyleAttributeRegistry = {
1408
1414
  allowedValues: overflowAllowlist,
1409
1415
  },
1410
1416
  // Color
1417
+ // Pointer input. On an overlay layer this is lifted onto the absolutely
1418
+ // positioned layer box — see resolveOverlayLayerPointerEvents.
1419
+ 'pointer-events-3-resolutions': {
1420
+ kind: 'enum',
1421
+ cssProperty: 'pointerEvents',
1422
+ allowedValues: pointerEventsAllowlist,
1423
+ },
1411
1424
  'background-color-3-resolutions': { kind: 'color', cssProperty: 'backgroundColor' },
1412
1425
  'color-3-resolutions': { kind: 'color', cssProperty: 'color' },
1413
1426
  // Background image and the painting properties that go with it. Independent
@@ -1834,6 +1847,7 @@ const normalizeCssClasses = (value) => {
1834
1847
  };
1835
1848
 
1836
1849
  const HIDE_WIDGET_ATTRIBUTE_NAME = 'hide-component-3-resolutions';
1850
+ const POINTER_EVENTS_ATTRIBUTE_NAME = 'pointer-events-3-resolutions';
1837
1851
  /**
1838
1852
  * Widget-level settings the editing canvas must not apply.
1839
1853
  *
@@ -1845,6 +1859,9 @@ const HIDE_WIDGET_ATTRIBUTE_NAME = 'hide-component-3-resolutions';
1845
1859
  * Flex layout, gap, colors, typography, opacity and CSS classes are absent
1846
1860
  * deliberately: they change how the canvas looks without taking away the room
1847
1861
  * or the affordances the author needs to keep working.
1862
+ *
1863
+ * `pointer-events` is here for the same reason as hiding: `none` would leave the
1864
+ * author with a widget they cannot click or drag at all.
1848
1865
  */
1849
1866
  const WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE = [
1850
1867
  'width-3-resolutions',
@@ -1862,6 +1879,7 @@ const WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE = [
1862
1879
  'overflow-x-3-resolutions',
1863
1880
  'overflow-y-3-resolutions',
1864
1881
  HIDE_WIDGET_ATTRIBUTE_NAME,
1882
+ POINTER_EVENTS_ATTRIBUTE_NAME,
1865
1883
  ];
1866
1884
  const ignoredInComposeMode = new Set(WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE);
1867
1885
  /**
@@ -1910,6 +1928,139 @@ function widgetBasedPropertiesAreAssigned(widgetContainerStyles) {
1910
1928
  return (Object.keys(widgetContainerStyles.styles).length > 0 ||
1911
1929
  !!widgetContainerStyles.cssClasses);
1912
1930
  }
1931
+ /**
1932
+ * True when the author gave the widget a height of its own, through either the
1933
+ * structured setting or the legacy raw container CSS.
1934
+ */
1935
+ function widgetDeclaresOwnHeight({ containerAttributes, widgetContainerStyles, }) {
1936
+ const containerCss = containerAttributes?.[cssAttrArrayKey] || [];
1937
+ return (containerCss.some((entry) => entry.toLowerCase().startsWith('height:')) || widgetContainerStyles.styles.height !== undefined);
1938
+ }
1939
+
1940
+ /**
1941
+ * The base's own place in the stack. Read here rather than through
1942
+ * objectStyleAttributeRegistry on purpose: the registry is shared with rows and
1943
+ * columns, and z-index is only meaningful to the widget wrapper for now.
1944
+ */
1945
+ const Z_INDEX_WIDGET_ATTRIBUTE_NAME = 'z-index-3-resolutions';
1946
+ /** Base z-index when the author set none. */
1947
+ const DEFAULT_BASE_Z_INDEX = 0;
1948
+ /** True when this Items asks for at least one layer over its rows. */
1949
+ function hasOverlayLayers(items) {
1950
+ return !!items?.overlayLayers?.layers?.length;
1951
+ }
1952
+ /**
1953
+ * The base's z-index for this device, or 0 when unset or unusable. Accepts the
1954
+ * number and the numeric string, since hand-authored JSON produces both.
1955
+ */
1956
+ function resolveBaseZIndex({ containerAttributes, deviceDisplayType, }) {
1957
+ const resolved = getDeviceTypeBasedAttributes({
1958
+ deviceDisplayType,
1959
+ componentAttributes: containerAttributes,
1960
+ });
1961
+ const value = resolved?.componentAttributesSpecificToDeviceType?.[Z_INDEX_WIDGET_ATTRIBUTE_NAME];
1962
+ if (typeof value === 'number' && Number.isFinite(value)) {
1963
+ return value;
1964
+ }
1965
+ if (typeof value === 'string' && value.trim().length) {
1966
+ const parsed = Number(value);
1967
+ if (Number.isFinite(parsed)) {
1968
+ return parsed;
1969
+ }
1970
+ }
1971
+ return DEFAULT_BASE_Z_INDEX;
1972
+ }
1973
+ /**
1974
+ * Where a layer sits above a base at `baseZIndex`: the first layer takes
1975
+ * `baseZIndex + 1`, the second `baseZIndex + 2`, and so on.
1976
+ *
1977
+ * Derived from the position in the array, never from the layer itself, so a
1978
+ * layer that renders nothing — hidden at this width, or with no rows — leaves
1979
+ * its number unused rather than pulling the layers above it down.
1980
+ */
1981
+ function getOverlayLayerZIndex(baseZIndex, layerIndex) {
1982
+ return baseZIndex + layerIndex + 1;
1983
+ }
1984
+ /**
1985
+ * A layer's `pointer-events` for this device, lifted from the layer's own
1986
+ * container settings. `undefined` leaves the property off the box entirely.
1987
+ *
1988
+ * The layer box covers the whole base, so this has to land there rather than on
1989
+ * the container nested inside it: `none` on an inner element still leaves the
1990
+ * box itself intercepting every click aimed at the base underneath. Because the
1991
+ * property inherits, one `none` on the layer also frees the layer's own content,
1992
+ * which can take input back with `auto` on the column that needs it.
1993
+ */
1994
+ function resolveOverlayLayerPointerEvents({ containerAttributes, deviceDisplayType, }) {
1995
+ const resolved = getDeviceTypeBasedAttributes({
1996
+ deviceDisplayType,
1997
+ componentAttributes: containerAttributes,
1998
+ });
1999
+ const pointerEvents = resolved?.styles?.pointerEvents;
2000
+ return typeof pointerEvents === 'string' ? pointerEvents : undefined;
2001
+ }
2002
+ /**
2003
+ * True when a layer has nothing to put on screen at this width, so its box is
2004
+ * not worth emitting. Its z-index slot still goes unclaimed — see
2005
+ * getOverlayLayerZIndex.
2006
+ */
2007
+ function isOverlayLayerEmptyForDevice({ layer, deviceDisplayType, }) {
2008
+ if (!layer?.rows?.length) {
2009
+ return true;
2010
+ }
2011
+ return isWidgetHiddenForDevice({
2012
+ containerAttributes: layer.containerAttributes,
2013
+ deviceDisplayType,
2014
+ });
2015
+ }
2016
+ /**
2017
+ * The stack wrapper: containing block for every layer, and the element whose
2018
+ * used width and height the layers resolve their `100%` against.
2019
+ *
2020
+ * It takes its size from the base in normal flow, so it carries no size of its
2021
+ * own beyond the height default it adopts from the vertical container — the page
2022
+ * root is full height, a collection is content height. `baseDeclaresOwnHeight`
2023
+ * drops even that, because a base pinned to an authored height has to be the
2024
+ * thing the layers match.
2025
+ *
2026
+ * `isolation: isolate` keeps the layer numbers a private matter between the base
2027
+ * and its layers. Without it they would be sorted against the host page, where
2028
+ * beating a sticky header was never the point.
2029
+ *
2030
+ * A non-zero base z-index lands here too, on the widget's outermost box, which
2031
+ * is the one the host page sorts. Nothing is emitted for the default 0: an
2032
+ * unpositioned stack already paints under its own layers, and staying out of the
2033
+ * host's stacking order is the better default.
2034
+ */
2035
+ function buildOverlayStackStyles({ isWithinCollection, baseDeclaresOwnHeight, baseZIndex, }) {
2036
+ return {
2037
+ position: 'relative',
2038
+ isolation: 'isolate',
2039
+ display: 'flex',
2040
+ flexDirection: 'column',
2041
+ ...(baseDeclaresOwnHeight
2042
+ ? {}
2043
+ : { height: isWithinCollection ? 'auto' : '100%' }),
2044
+ ...(baseZIndex === DEFAULT_BASE_Z_INDEX ? {} : { zIndex: baseZIndex }),
2045
+ };
2046
+ }
2047
+ /**
2048
+ * One layer's box: out of flow so it cannot inflate the stack it is measuring
2049
+ * itself against, stretched to that stack's padding box, and sized in border-box
2050
+ * so a layer's own border or padding stays inside the base's footprint.
2051
+ */
2052
+ function buildOverlayLayerBoxStyles({ zIndex, pointerEvents, }) {
2053
+ return {
2054
+ position: 'absolute',
2055
+ top: 0,
2056
+ left: 0,
2057
+ width: '100%',
2058
+ height: '100%',
2059
+ boxSizing: 'border-box',
2060
+ zIndex,
2061
+ ...(pointerEvents ? { pointerEvents } : {}),
2062
+ };
2063
+ }
1913
2064
 
1914
2065
  const COMPONENT_PROPS_PATH_SEPARATOR = '/';
1915
2066
  /**
@@ -2039,6 +2190,9 @@ function scanItemsForDivergence(items) {
2039
2190
  if (!items?.rows?.length) {
2040
2191
  return false;
2041
2192
  }
2193
+ if (scanAttributeBagForDivergence(items.containerAttributes)) {
2194
+ return true;
2195
+ }
2042
2196
  for (const row of items.rows) {
2043
2197
  if (scanAttributeBagForDivergence(row.rowAttributes)) {
2044
2198
  return true;
@@ -2049,6 +2203,11 @@ function scanItemsForDivergence(items) {
2049
2203
  }
2050
2204
  }
2051
2205
  }
2206
+ for (const layer of items.overlayLayers?.layers ?? []) {
2207
+ if (scanItemsForDivergence(layer)) {
2208
+ return true;
2209
+ }
2210
+ }
2052
2211
  return false;
2053
2212
  }
2054
2213
  function scanAttributeBagForDivergence(attributes) {
@@ -2192,7 +2351,10 @@ class EmbedInVerticalContainerComponent {
2192
2351
  .filter(Boolean)
2193
2352
  .join(' ');
2194
2353
  this.wrapperStyle = {
2195
- ...(containerCss.some((entry) => entry.toLowerCase().startsWith('height:'))
2354
+ ...(widgetDeclaresOwnHeight({
2355
+ containerAttributes: this.displayItemList.containerAttributes,
2356
+ widgetContainerStyles,
2357
+ })
2196
2358
  ? {}
2197
2359
  : { height: this.isWithinCollection ? 'auto' : '100%' }),
2198
2360
  display: 'flex',
@@ -2575,6 +2737,57 @@ class RenderComponentsInnerComponent {
2575
2737
  get components() {
2576
2738
  return getComponentsPluginFromPlugins(this.plugins).components;
2577
2739
  }
2740
+ get shouldStack() {
2741
+ return (!this.isComposeMode &&
2742
+ hasOverlayLayers(this.displayItemList) &&
2743
+ !isWidgetHiddenForDevice({
2744
+ containerAttributes: this.displayItemList.containerAttributes,
2745
+ deviceDisplayType: this.deviceDisplayType,
2746
+ }));
2747
+ }
2748
+ get stackStyles() {
2749
+ const baseZIndex = resolveBaseZIndex({
2750
+ containerAttributes: this.displayItemList.containerAttributes,
2751
+ deviceDisplayType: this.deviceDisplayType,
2752
+ });
2753
+ return buildOverlayStackStyles({
2754
+ isWithinCollection: this.isWithinCollection,
2755
+ baseDeclaresOwnHeight: widgetDeclaresOwnHeight({
2756
+ containerAttributes: this.displayItemList.containerAttributes,
2757
+ widgetContainerStyles: resolveWidgetContainerStyles({
2758
+ containerAttributes: this.displayItemList.containerAttributes,
2759
+ deviceDisplayType: this.deviceDisplayType,
2760
+ isComposeMode: this.isComposeMode,
2761
+ }),
2762
+ }),
2763
+ baseZIndex,
2764
+ });
2765
+ }
2766
+ get overlayLayerViews() {
2767
+ const layers = this.displayItemList.overlayLayers?.layers ?? [];
2768
+ const baseZIndex = resolveBaseZIndex({
2769
+ containerAttributes: this.displayItemList.containerAttributes,
2770
+ deviceDisplayType: this.deviceDisplayType,
2771
+ });
2772
+ return layers.flatMap((layer, index) => {
2773
+ if (isOverlayLayerEmptyForDevice({ layer, deviceDisplayType: this.deviceDisplayType })) {
2774
+ return [];
2775
+ }
2776
+ return [
2777
+ {
2778
+ index,
2779
+ layer,
2780
+ boxStyles: buildOverlayLayerBoxStyles({
2781
+ zIndex: getOverlayLayerZIndex(baseZIndex, index),
2782
+ pointerEvents: resolveOverlayLayerPointerEvents({
2783
+ containerAttributes: layer.containerAttributes,
2784
+ deviceDisplayType: this.deviceDisplayType,
2785
+ }),
2786
+ }),
2787
+ },
2788
+ ];
2789
+ });
2790
+ }
2578
2791
  isRenderableColumn(col) {
2579
2792
  if (this.isComposeMode && col.type === DisplayItemTypes.DroppableBox) {
2580
2793
  return false;
@@ -2590,7 +2803,6 @@ class RenderComponentsInnerComponent {
2590
2803
  if (!this.isComposeMode && isHidden) {
2591
2804
  return false;
2592
2805
  }
2593
- // stash for template helpers — computed again in columnView
2594
2806
  void componentStyles;
2595
2807
  return true;
2596
2808
  }
@@ -2632,109 +2844,174 @@ class RenderComponentsInnerComponent {
2632
2844
  }
2633
2845
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: RenderComponentsInnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2634
2846
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: RenderComponentsInnerComponent, isStandalone: true, selector: "rulecms-render-inner", inputs: { displayItemList: "displayItemList", isComposeMode: "isComposeMode", isWithinCollection: "isWithinCollection", widgetCollections: "widgetCollections", showDropContainers: "showDropContainers", reduxDeviceDisplayType: "reduxDeviceDisplayType", plugins: "plugins", deviceDisplayType: "deviceDisplayType", componentProps: "componentProps", mounts: "mounts", ancestorColumnIds: "ancestorColumnIds" }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
2635
- <rulecms-embed-vertical
2636
- [displayItemList]="displayItemList"
2637
- [isComposeMode]="isComposeMode"
2638
- [showDropContainers]="showDropContainers"
2639
- [isWithinCollection]="isWithinCollection"
2640
- [deviceDisplayType]="deviceDisplayType"
2641
- >
2642
- @for (row of displayItemList.rows; track row.id) {
2643
- <rulecms-embed-row
2644
- [row]="row"
2645
- [isComposeMode]="isComposeMode"
2646
- [showDropContainers]="showDropContainers"
2647
- [isWithinCollection]="isWithinCollection"
2648
- [deviceDisplayType]="deviceDisplayType"
2649
- >
2650
- @for (col of row.columns; track col.id) {
2651
- @if (isRenderableColumn(col)) {
2652
- @if (collectionFor(col); as collectionItems) {
2653
- <rulecms-render-inner
2654
- [displayItemList]="collectionItems"
2655
- [isComposeMode]="isComposeMode"
2656
- [isWithinCollection]="true"
2657
- [widgetCollections]="widgetCollections"
2658
- [showDropContainers]="showDropContainers"
2659
- [reduxDeviceDisplayType]="reduxDeviceDisplayType"
2660
- [plugins]="plugins"
2661
- [deviceDisplayType]="deviceDisplayType"
2662
- [componentProps]="componentProps"
2663
- [mounts]="mounts"
2664
- [ancestorColumnIds]="childAncestorIds(col.id)"
2665
- />
2666
- } @else {
2667
- <rulecms-display-component
2668
- [componentType]="col.type"
2669
- [libraryId]="col.libraryId"
2670
- [componentAttributes]="columnView(col).componentAttributes"
2671
- [components]="components"
2672
- [styleProps]="columnView(col).styleProps"
2673
- [widgetInstanceProps]="instanceProps(col.id)"
2674
- [mounts]="mounts"
2675
- />
2847
+ <ng-template #baseTree>
2848
+ <rulecms-embed-vertical
2849
+ [displayItemList]="displayItemList"
2850
+ [isComposeMode]="isComposeMode"
2851
+ [showDropContainers]="showDropContainers"
2852
+ [isWithinCollection]="isWithinCollection"
2853
+ [deviceDisplayType]="deviceDisplayType"
2854
+ >
2855
+ @for (row of displayItemList.rows; track row.id) {
2856
+ <rulecms-embed-row
2857
+ [row]="row"
2858
+ [isComposeMode]="isComposeMode"
2859
+ [showDropContainers]="showDropContainers"
2860
+ [isWithinCollection]="isWithinCollection"
2861
+ [deviceDisplayType]="deviceDisplayType"
2862
+ >
2863
+ @for (col of row.columns; track col.id) {
2864
+ @if (isRenderableColumn(col)) {
2865
+ @if (collectionFor(col); as collectionItems) {
2866
+ <rulecms-render-inner
2867
+ [displayItemList]="collectionItems"
2868
+ [isComposeMode]="isComposeMode"
2869
+ [isWithinCollection]="true"
2870
+ [widgetCollections]="widgetCollections"
2871
+ [showDropContainers]="showDropContainers"
2872
+ [reduxDeviceDisplayType]="reduxDeviceDisplayType"
2873
+ [plugins]="plugins"
2874
+ [deviceDisplayType]="deviceDisplayType"
2875
+ [componentProps]="componentProps"
2876
+ [mounts]="mounts"
2877
+ [ancestorColumnIds]="childAncestorIds(col.id)"
2878
+ />
2879
+ } @else {
2880
+ <rulecms-display-component
2881
+ [componentType]="col.type"
2882
+ [libraryId]="col.libraryId"
2883
+ [componentAttributes]="columnView(col).componentAttributes"
2884
+ [components]="components"
2885
+ [styleProps]="columnView(col).styleProps"
2886
+ [widgetInstanceProps]="instanceProps(col.id)"
2887
+ [mounts]="mounts"
2888
+ />
2889
+ }
2676
2890
  }
2677
2891
  }
2678
- }
2679
- </rulecms-embed-row>
2680
- }
2681
- </rulecms-embed-vertical>
2682
- `, isInline: true, dependencies: [{ kind: "component", type: RenderComponentsInnerComponent, selector: "rulecms-render-inner", inputs: ["displayItemList", "isComposeMode", "isWithinCollection", "widgetCollections", "showDropContainers", "reduxDeviceDisplayType", "plugins", "deviceDisplayType", "componentProps", "mounts", "ancestorColumnIds"] }, { kind: "component", type: EmbedInVerticalContainerComponent, selector: "rulecms-embed-vertical", inputs: ["displayItemList", "isComposeMode", "showDropContainers", "isWithinCollection", "deviceDisplayType"] }, { kind: "component", type: EmbedInRowComponent, selector: "rulecms-embed-row", inputs: ["row", "isComposeMode", "showDropContainers", "isWithinCollection", "deviceDisplayType"] }, { kind: "component", type: DisplayComponentComponent, selector: "rulecms-display-component", inputs: ["componentType", "libraryId", "componentAttributes", "components", "styleProps", "widgetInstanceProps", "mounts"] }] }); }
2892
+ </rulecms-embed-row>
2893
+ }
2894
+ </rulecms-embed-vertical>
2895
+ </ng-template>
2896
+
2897
+ @if (shouldStack) {
2898
+ <div [style]="stackStyles">
2899
+ <ng-container *ngTemplateOutlet="baseTree" />
2900
+ @for (entry of overlayLayerViews; track entry.index) {
2901
+ <div
2902
+ [attr.data-rulecms-overlay-layer]="entry.index"
2903
+ [style]="entry.boxStyles"
2904
+ >
2905
+ <rulecms-render-inner
2906
+ [displayItemList]="entry.layer"
2907
+ [isComposeMode]="isComposeMode"
2908
+ [isWithinCollection]="false"
2909
+ [widgetCollections]="widgetCollections"
2910
+ [showDropContainers]="false"
2911
+ [reduxDeviceDisplayType]="reduxDeviceDisplayType"
2912
+ [plugins]="plugins"
2913
+ [deviceDisplayType]="deviceDisplayType"
2914
+ [componentProps]="componentProps"
2915
+ [mounts]="mounts"
2916
+ [ancestorColumnIds]="ancestorColumnIds"
2917
+ />
2918
+ </div>
2919
+ }
2920
+ </div>
2921
+ } @else {
2922
+ <ng-container *ngTemplateOutlet="baseTree" />
2923
+ }
2924
+ `, isInline: true, dependencies: [{ kind: "component", type: RenderComponentsInnerComponent, selector: "rulecms-render-inner", inputs: ["displayItemList", "isComposeMode", "isWithinCollection", "widgetCollections", "showDropContainers", "reduxDeviceDisplayType", "plugins", "deviceDisplayType", "componentProps", "mounts", "ancestorColumnIds"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: EmbedInVerticalContainerComponent, selector: "rulecms-embed-vertical", inputs: ["displayItemList", "isComposeMode", "showDropContainers", "isWithinCollection", "deviceDisplayType"] }, { kind: "component", type: EmbedInRowComponent, selector: "rulecms-embed-row", inputs: ["row", "isComposeMode", "showDropContainers", "isWithinCollection", "deviceDisplayType"] }, { kind: "component", type: DisplayComponentComponent, selector: "rulecms-display-component", inputs: ["componentType", "libraryId", "componentAttributes", "components", "styleProps", "widgetInstanceProps", "mounts"] }] }); }
2683
2925
  }
2684
2926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: RenderComponentsInnerComponent, decorators: [{
2685
2927
  type: Component,
2686
2928
  args: [{
2687
2929
  selector: 'rulecms-render-inner',
2688
2930
  standalone: true,
2689
- imports: [EmbedInVerticalContainerComponent, EmbedInRowComponent, DisplayComponentComponent],
2931
+ imports: [
2932
+ NgTemplateOutlet,
2933
+ EmbedInVerticalContainerComponent,
2934
+ EmbedInRowComponent,
2935
+ DisplayComponentComponent,
2936
+ ],
2690
2937
  template: `
2691
- <rulecms-embed-vertical
2692
- [displayItemList]="displayItemList"
2693
- [isComposeMode]="isComposeMode"
2694
- [showDropContainers]="showDropContainers"
2695
- [isWithinCollection]="isWithinCollection"
2696
- [deviceDisplayType]="deviceDisplayType"
2697
- >
2698
- @for (row of displayItemList.rows; track row.id) {
2699
- <rulecms-embed-row
2700
- [row]="row"
2701
- [isComposeMode]="isComposeMode"
2702
- [showDropContainers]="showDropContainers"
2703
- [isWithinCollection]="isWithinCollection"
2704
- [deviceDisplayType]="deviceDisplayType"
2705
- >
2706
- @for (col of row.columns; track col.id) {
2707
- @if (isRenderableColumn(col)) {
2708
- @if (collectionFor(col); as collectionItems) {
2709
- <rulecms-render-inner
2710
- [displayItemList]="collectionItems"
2711
- [isComposeMode]="isComposeMode"
2712
- [isWithinCollection]="true"
2713
- [widgetCollections]="widgetCollections"
2714
- [showDropContainers]="showDropContainers"
2715
- [reduxDeviceDisplayType]="reduxDeviceDisplayType"
2716
- [plugins]="plugins"
2717
- [deviceDisplayType]="deviceDisplayType"
2718
- [componentProps]="componentProps"
2719
- [mounts]="mounts"
2720
- [ancestorColumnIds]="childAncestorIds(col.id)"
2721
- />
2722
- } @else {
2723
- <rulecms-display-component
2724
- [componentType]="col.type"
2725
- [libraryId]="col.libraryId"
2726
- [componentAttributes]="columnView(col).componentAttributes"
2727
- [components]="components"
2728
- [styleProps]="columnView(col).styleProps"
2729
- [widgetInstanceProps]="instanceProps(col.id)"
2730
- [mounts]="mounts"
2731
- />
2938
+ <ng-template #baseTree>
2939
+ <rulecms-embed-vertical
2940
+ [displayItemList]="displayItemList"
2941
+ [isComposeMode]="isComposeMode"
2942
+ [showDropContainers]="showDropContainers"
2943
+ [isWithinCollection]="isWithinCollection"
2944
+ [deviceDisplayType]="deviceDisplayType"
2945
+ >
2946
+ @for (row of displayItemList.rows; track row.id) {
2947
+ <rulecms-embed-row
2948
+ [row]="row"
2949
+ [isComposeMode]="isComposeMode"
2950
+ [showDropContainers]="showDropContainers"
2951
+ [isWithinCollection]="isWithinCollection"
2952
+ [deviceDisplayType]="deviceDisplayType"
2953
+ >
2954
+ @for (col of row.columns; track col.id) {
2955
+ @if (isRenderableColumn(col)) {
2956
+ @if (collectionFor(col); as collectionItems) {
2957
+ <rulecms-render-inner
2958
+ [displayItemList]="collectionItems"
2959
+ [isComposeMode]="isComposeMode"
2960
+ [isWithinCollection]="true"
2961
+ [widgetCollections]="widgetCollections"
2962
+ [showDropContainers]="showDropContainers"
2963
+ [reduxDeviceDisplayType]="reduxDeviceDisplayType"
2964
+ [plugins]="plugins"
2965
+ [deviceDisplayType]="deviceDisplayType"
2966
+ [componentProps]="componentProps"
2967
+ [mounts]="mounts"
2968
+ [ancestorColumnIds]="childAncestorIds(col.id)"
2969
+ />
2970
+ } @else {
2971
+ <rulecms-display-component
2972
+ [componentType]="col.type"
2973
+ [libraryId]="col.libraryId"
2974
+ [componentAttributes]="columnView(col).componentAttributes"
2975
+ [components]="components"
2976
+ [styleProps]="columnView(col).styleProps"
2977
+ [widgetInstanceProps]="instanceProps(col.id)"
2978
+ [mounts]="mounts"
2979
+ />
2980
+ }
2732
2981
  }
2733
2982
  }
2734
- }
2735
- </rulecms-embed-row>
2736
- }
2737
- </rulecms-embed-vertical>
2983
+ </rulecms-embed-row>
2984
+ }
2985
+ </rulecms-embed-vertical>
2986
+ </ng-template>
2987
+
2988
+ @if (shouldStack) {
2989
+ <div [style]="stackStyles">
2990
+ <ng-container *ngTemplateOutlet="baseTree" />
2991
+ @for (entry of overlayLayerViews; track entry.index) {
2992
+ <div
2993
+ [attr.data-rulecms-overlay-layer]="entry.index"
2994
+ [style]="entry.boxStyles"
2995
+ >
2996
+ <rulecms-render-inner
2997
+ [displayItemList]="entry.layer"
2998
+ [isComposeMode]="isComposeMode"
2999
+ [isWithinCollection]="false"
3000
+ [widgetCollections]="widgetCollections"
3001
+ [showDropContainers]="false"
3002
+ [reduxDeviceDisplayType]="reduxDeviceDisplayType"
3003
+ [plugins]="plugins"
3004
+ [deviceDisplayType]="deviceDisplayType"
3005
+ [componentProps]="componentProps"
3006
+ [mounts]="mounts"
3007
+ [ancestorColumnIds]="ancestorColumnIds"
3008
+ />
3009
+ </div>
3010
+ }
3011
+ </div>
3012
+ } @else {
3013
+ <ng-container *ngTemplateOutlet="baseTree" />
3014
+ }
2738
3015
  `,
2739
3016
  host: { style: 'display: contents' },
2740
3017
  }]
@@ -3546,5 +3823,5 @@ async function resolveWidgetLibraries(params) {
3546
3823
  * Generated bundle index. Do not edit.
3547
3824
  */
3548
3825
 
3549
- export { AlignContentTypes, BreakpointVariantRenderComponent, COLLECTION_TYPE_PREFIX, COMPONENT_PROPS_PATH_SEPARATOR, CSS_CLASSES_ATTRIBUTE_NAME, CSS_VARIABLE_NAME_MAX_LENGTH, CSS_VARIABLE_NAME_PATTERN, DEFAULT_CLOUDINARY_CLOUD_NAME, DEFAULT_LIBRARY_ID, DEFAULT_ROW_GAP, DEV_CLIENT_TOKEN_PREFIX, DEV_WIDGET_API_PATH, DeviceDisplayTypes, DisplayComponentComponent, DisplayItemTypes, DragItemIdPrefixTypes, EMBEDDED_KEY_SEPARATOR, FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY, FetchRuleCMSWidgetError, HIDE_WIDGET_ATTRIBUTE_NAME, JustifyContentTypes, PUBLISHED_KEY_SEPARATOR, PUBLISHED_WIDGET_API_PATH, PageViewTypes, RULECMS_API_ORIGIN, RULECMS_PUBLISHED_KEY_ATTRIBUTE, RenderComponentsComponent, RenderComponentsForDeviceComponent, RenderComponentsInnerComponent, RuleCMSWidgetComponent, RuleCMSWidgetContextService, RuleCMSWidgetProviderComponent, WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE, WIDGET_CACHE_API_ORIGIN, alignContentAllowlist, alignItemsAllowlist, backgroundPositionAllowlist, backgroundRepeatAllowlist, backgroundSizeAllowlist, borderStyleKeywords, boxSpacingSideKeys, boxSpacingStyleAttributeEntries, buildCloudinaryBackgroundUrl, buildWidgetFetchUrl, collectComponentInstancePaths, collectReferencedLibraryIds, composeSourceComponentsPlugin, createComponentLibraryRegistry, cssAttrArrayKey, defaultPageWidth, deriveDisplayFlexIfNeeded, desktopModeWidth, fetchRuleCMSWidget, findUnmatchedComponentPropsKeys, flexDirectionAllowlist, flexWrapAllowlist, fontFamilyAllowlist, fontStyleAllowlist, fontWeightAllowlist, formatBackgroundImageStyles, formatBorderStyles, formatBoxShadowStyles, formatBoxSpacingStyles, formatCssColorStyles, formatCssColorValue, formatCssEnumStyles, formatCssLengthStyles, formatCssVariable, formatCssVariableStyles, formatLineHeightStyles, formatObjectStyleAttribute, formatOpacityStyles, formatSpacingSideValue, generatePublishedKey, generatePublishedKeyForEmbedded, getCollectionIdForCollectionType, getColumnAttributes, getComponentAttributesAndStyles, getComponentsPluginFromPlugins, getCssVariableFromLeaf, getDefaultDimensionAttributes, getDeviceTypeBasedAttributes, getDragItemId, getDragItemPrefixAndId, getIdAndPrefix, getMergedAttributes, getNameAndInstanceIdFromWidgetKey, getNameFromWidgetKey, getWidgetKeyForCollection, getWidgetKeyForCollectionWithPrefix, getWidgetKeyForPublishedCollection, getWidgetKeyForPublishedCollectionWithPrefix, hasBoxShadowLeaf, hasDeviceDivergentValues, hasInvalidCssVariable, hasItems, incrementVersion, isBackgroundImageValue, isBorderStyleValue, isBorderValue, isBoxShadowValue, isBoxSpacingValue, isCloudinaryCloudName, isCloudinaryPublicId, isCloudinaryTransformationString, isCssColorValue, isCssEnumValue, isCssVariableName, isDevClientToken, isLineHeightValue, isOpacityValue, isRowHiddenForDevice, isSafeImageUrl, isSpacingSideValue, isWidgetHiddenForDevice, justifyContentAllowlist, normalizeCssClasses, objectStyleAttributeRegistry, overflowAllowlist, phoneModeWidth, prepareRuleCMSWidgetData, resolveKey, resolveRowStyles, resolveWidgetApiOrigin, resolveWidgetContainerStyles, resolveWidgetInstanceProps, resolveWidgetLibraries, rowBasedPropertiesAreAssigned, spacingKeywords, spacingLengthUnits, tabletModeWidth, textAlignAllowlist, textDecorationAllowlist, textTransformAllowlist, typeHasPrefix, warnUnmatchedComponentProps, widgetBasedPropertiesAreAssigned };
3826
+ export { AlignContentTypes, BreakpointVariantRenderComponent, COLLECTION_TYPE_PREFIX, COMPONENT_PROPS_PATH_SEPARATOR, CSS_CLASSES_ATTRIBUTE_NAME, CSS_VARIABLE_NAME_MAX_LENGTH, CSS_VARIABLE_NAME_PATTERN, DEFAULT_BASE_Z_INDEX, DEFAULT_CLOUDINARY_CLOUD_NAME, DEFAULT_LIBRARY_ID, DEFAULT_ROW_GAP, DEV_CLIENT_TOKEN_PREFIX, DEV_WIDGET_API_PATH, DeviceDisplayTypes, DisplayComponentComponent, DisplayItemTypes, DragItemIdPrefixTypes, EMBEDDED_KEY_SEPARATOR, FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY, FetchRuleCMSWidgetError, HIDE_WIDGET_ATTRIBUTE_NAME, JustifyContentTypes, POINTER_EVENTS_ATTRIBUTE_NAME, PUBLISHED_KEY_SEPARATOR, PUBLISHED_WIDGET_API_PATH, PageViewTypes, RULECMS_API_ORIGIN, RULECMS_PUBLISHED_KEY_ATTRIBUTE, RenderComponentsComponent, RenderComponentsForDeviceComponent, RenderComponentsInnerComponent, RuleCMSWidgetComponent, RuleCMSWidgetContextService, RuleCMSWidgetProviderComponent, WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE, WIDGET_CACHE_API_ORIGIN, Z_INDEX_WIDGET_ATTRIBUTE_NAME, alignContentAllowlist, alignItemsAllowlist, backgroundPositionAllowlist, backgroundRepeatAllowlist, backgroundSizeAllowlist, borderStyleKeywords, boxSpacingSideKeys, boxSpacingStyleAttributeEntries, buildCloudinaryBackgroundUrl, buildOverlayLayerBoxStyles, buildOverlayStackStyles, buildWidgetFetchUrl, collectComponentInstancePaths, collectReferencedLibraryIds, composeSourceComponentsPlugin, createComponentLibraryRegistry, cssAttrArrayKey, defaultPageWidth, deriveDisplayFlexIfNeeded, desktopModeWidth, fetchRuleCMSWidget, findUnmatchedComponentPropsKeys, flexDirectionAllowlist, flexWrapAllowlist, fontFamilyAllowlist, fontStyleAllowlist, fontWeightAllowlist, formatBackgroundImageStyles, formatBorderStyles, formatBoxShadowStyles, formatBoxSpacingStyles, formatCssColorStyles, formatCssColorValue, formatCssEnumStyles, formatCssLengthStyles, formatCssVariable, formatCssVariableStyles, formatLineHeightStyles, formatObjectStyleAttribute, formatOpacityStyles, formatSpacingSideValue, generatePublishedKey, generatePublishedKeyForEmbedded, getCollectionIdForCollectionType, getColumnAttributes, getComponentAttributesAndStyles, getComponentsPluginFromPlugins, getCssVariableFromLeaf, getDefaultDimensionAttributes, getDeviceTypeBasedAttributes, getDragItemId, getDragItemPrefixAndId, getIdAndPrefix, getMergedAttributes, getNameAndInstanceIdFromWidgetKey, getNameFromWidgetKey, getOverlayLayerZIndex, getWidgetKeyForCollection, getWidgetKeyForCollectionWithPrefix, getWidgetKeyForPublishedCollection, getWidgetKeyForPublishedCollectionWithPrefix, hasBoxShadowLeaf, hasDeviceDivergentValues, hasInvalidCssVariable, hasItems, hasOverlayLayers, incrementVersion, isBackgroundImageValue, isBorderStyleValue, isBorderValue, isBoxShadowValue, isBoxSpacingValue, isCloudinaryCloudName, isCloudinaryPublicId, isCloudinaryTransformationString, isCssColorValue, isCssEnumValue, isCssVariableName, isDevClientToken, isLineHeightValue, isOpacityValue, isOverlayLayerEmptyForDevice, isRowHiddenForDevice, isSafeImageUrl, isSpacingSideValue, isWidgetHiddenForDevice, justifyContentAllowlist, normalizeCssClasses, objectStyleAttributeRegistry, overflowAllowlist, phoneModeWidth, pointerEventsAllowlist, prepareRuleCMSWidgetData, resolveBaseZIndex, resolveKey, resolveOverlayLayerPointerEvents, resolveRowStyles, resolveWidgetApiOrigin, resolveWidgetContainerStyles, resolveWidgetInstanceProps, resolveWidgetLibraries, rowBasedPropertiesAreAssigned, spacingKeywords, spacingLengthUnits, tabletModeWidth, textAlignAllowlist, textDecorationAllowlist, textTransformAllowlist, typeHasPrefix, warnUnmatchedComponentProps, widgetBasedPropertiesAreAssigned, widgetDeclaresOwnHeight };
3550
3827
  //# sourceMappingURL=rulecms-widget-angular.mjs.map