@vectoriox/iox-builder 1.9.3 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "1.9.3",
3
+ "version": "2.0.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -1,11 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ComponentRef, Type, ChangeDetectorRef, OnInit, AfterViewInit, OnChanges, OnDestroy, EventEmitter, ElementRef, ApplicationRef, SimpleChanges, ViewContainerRef, Injector, EnvironmentInjector, InjectionToken, TemplateRef, AfterContentInit, QueryList } from '@angular/core';
3
3
  import * as rxjs from 'rxjs';
4
- import { Subject, Subscription, BehaviorSubject } from 'rxjs';
4
+ import { Subject, Subscription, BehaviorSubject, Observable } from 'rxjs';
5
5
  import * as _vectoriox_iox_builder from '@vectoriox/iox-builder';
6
6
  import * as i23 from 'primeng/popover';
7
7
  import { Popover } from 'primeng/popover';
8
- import { ActivatedRoute } from '@angular/router';
8
+ import { HttpClient } from '@angular/common/http';
9
+ import * as i28 from '@vectoriox/iox-ui';
10
+ import { DataSourceEndpoints } from '@vectoriox/iox-ui';
11
+ export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
9
12
  import * as i20 from '@angular/cdk/drag-drop';
10
13
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
11
14
  import * as i18 from '@angular/common';
@@ -16,8 +19,6 @@ import * as i24 from 'primeng/inputtext';
16
19
  import * as i25 from 'primeng/select';
17
20
  import * as i26 from 'primeng/tooltip';
18
21
  import * as i27 from 'primeng/dialog';
19
- import * as i28 from '@vectoriox/iox-ui';
20
- export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
21
22
 
22
23
  declare enum StyleCategory {
23
24
  Layout = "Layout",
@@ -1638,32 +1639,53 @@ declare class BuilderLinkedContainerComponent implements OnInit, OnDestroy {
1638
1639
  static ɵcmp: i0.ɵɵComponentDeclaration<BuilderLinkedContainerComponent, "app-builder-linked-container", never, { "children": { "alias": "children"; "required": false; }; "style": { "alias": "style"; "required": false; }; "nodeId": { "alias": "nodeId"; "required": false; }; "dropListId": { "alias": "dropListId"; "required": false; }; "linkType": { "alias": "linkType"; "required": false; }; "url": { "alias": "url"; "required": false; }; "pageRoute": { "alias": "pageRoute"; "required": false; }; "target": { "alias": "target"; "required": false; }; }, { "childClick": "childClick"; "childMouseEnter": "childMouseEnter"; "childMouseLeave": "childMouseLeave"; }, never, never, false, never>;
1639
1640
  }
1640
1641
 
1641
- /** Optional CMS content fetcher. Provide from the host app to enable Repeater data preview. */
1642
- declare const IOX_CONTENT_SERVICE: InjectionToken<IoxContentService>;
1643
- /** Optional shop content fetcher. Provide from the host app to enable Repeater shop data preview. */
1644
- declare const IOX_SHOP_SERVICE: InjectionToken<IoxContentService>;
1645
- /** Optional font manager. Provide from the host app to populate the fontFamily dropdown. */
1646
- declare const IOX_FONT_MANAGER: InjectionToken<IoxFontManager>;
1647
- interface IoxContentService {
1648
- getContent(contentType: string, orgId?: string): rxjs.Observable<any>;
1649
- }
1650
- interface IoxFontManager {
1651
- loadFonts(orgId: string): void;
1652
- uploadedFonts$: rxjs.Observable<any>;
1653
- getAllFontOptions(): {
1654
- label: string;
1655
- value: string;
1656
- }[];
1642
+ /**
1643
+ * Public content bases the builder canvas resolves data against — the SAME `@Public()` controllers
1644
+ * the live storefront (SSR engine) hits, so the canvas preview shows what the published page shows.
1645
+ * Provide from the host app, e.g. `{ cmsBase: config.host + 'api/', shopBase: config.host + 'api/shop/' }`.
1646
+ */
1647
+ declare const IOX_DATA_SOURCE_ENDPOINTS: InjectionToken<DataSourceEndpoints>;
1648
+ /**
1649
+ * THE data fetch for every canvas component that renders a data source (Repeater, SliderContainer)
1650
+ * and for the bindings preview.
1651
+ *
1652
+ * Before this existed, each of those fetched by itself through an injected admin content service
1653
+ * (`getContent(contentType, orgId)` → `api/org/:orgId/resources/:type`), which takes NO filters:
1654
+ * the data source's `filterByQueryParams` / `filterByRouteParam` were silently ignored, so the
1655
+ * canvas always showed the whole unfiltered collection, and the live SSR site — which does apply
1656
+ * them — rendered something different. Every caller now runs the SHARED `planDataSource` from
1657
+ * `@vectoriox/iox-ui` against the public controllers, exactly like the SSR engine.
1658
+ */
1659
+ declare class BuilderDataSourceService {
1660
+ private http;
1661
+ private endpoints;
1662
+ constructor(http: HttpClient, endpoints: DataSourceEndpoints | null);
1663
+ /** True when the host app wired the public endpoints — without them nothing can be fetched. */
1664
+ get isConfigured(): boolean;
1665
+ /**
1666
+ * Resolve a data source to the value its MODE describes: the item for a `single` source, the
1667
+ * array for a `list`. The builder is design time — there are no live route or query params — so
1668
+ * a route filter falls back to `defaultId` and a query filter to its `defaultValue`, which is
1669
+ * exactly what `planDataSource` does with empty params.
1670
+ *
1671
+ * Callers pass the source itself (resolved from their own page-scoped
1672
+ * `DataSourceRegistryService`) rather than an alias: this service is module-scoped and must not
1673
+ * capture a registry from the wrong injector. Emits `null` when the source resolves to no
1674
+ * request or the fetch fails — the canvas degrades to an empty preview, it never throws.
1675
+ */
1676
+ fetch(ds: IoxDataSource | undefined): Observable<any>;
1677
+ /** Same fetch, always as an array — for the canvas components that repeat over the source. */
1678
+ fetchItems(ds: IoxDataSource | undefined): Observable<any[]>;
1679
+ static ɵfac: i0.ɵɵFactoryDeclaration<BuilderDataSourceService, [null, { optional: true; }]>;
1680
+ static ɵprov: i0.ɵɵInjectableDeclaration<BuilderDataSourceService>;
1657
1681
  }
1658
1682
 
1659
1683
  declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
1660
1684
  private dragEngine;
1661
1685
  private overlayService;
1662
- private contentService;
1663
- private shopContentService;
1686
+ private dataSourceService;
1664
1687
  private dsRegistry;
1665
1688
  private panelEventService;
1666
- private activatedRoute;
1667
1689
  private cdr;
1668
1690
  children: ComponentNode[];
1669
1691
  style: {
@@ -1681,21 +1703,22 @@ declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
1681
1703
  readonly refreshPreviewsBound: () => void;
1682
1704
  private _source;
1683
1705
  private _limit;
1684
- private orgId;
1685
1706
  private bindingSub?;
1686
1707
  get source(): string;
1687
1708
  set source(value: string);
1688
1709
  get limit(): number;
1689
1710
  set limit(value: number);
1690
- constructor(dragEngine: DragEngineService, overlayService: OverlayService, contentService: IoxContentService | null, shopContentService: IoxContentService | null, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, activatedRoute: ActivatedRoute, cdr: ChangeDetectorRef);
1711
+ constructor(dragEngine: DragEngineService, overlayService: OverlayService, dataSourceService: BuilderDataSourceService, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, cdr: ChangeDetectorRef);
1691
1712
  ngOnInit(): void;
1692
1713
  ngOnDestroy(): void;
1693
1714
  onDrop(event: IoxDropEvent): void;
1715
+ /** Data comes from the SHARED resolver (public controllers + the source's own filters) — the
1716
+ * same decision the SSR engine runs, so the canvas preview matches the published page. */
1694
1717
  private fetchData;
1695
1718
  private isInTemplate;
1696
1719
  private refreshPreviews;
1697
1720
  private applyFirstItemToTemplate;
1698
- static ɵfac: i0.ɵɵFactoryDeclaration<BuilderRepeaterComponent, [null, null, { optional: true; }, { optional: true; }, null, null, null, null]>;
1721
+ static ɵfac: i0.ɵɵFactoryDeclaration<BuilderRepeaterComponent, never>;
1699
1722
  static ɵcmp: i0.ɵɵComponentDeclaration<BuilderRepeaterComponent, "app-builder-repeater", never, { "children": { "alias": "children"; "required": false; }; "style": { "alias": "style"; "required": false; }; "nodeId": { "alias": "nodeId"; "required": false; }; "dropListId": { "alias": "dropListId"; "required": false; }; "source": { "alias": "source"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; }, { "childClick": "childClick"; "childMouseEnter": "childMouseEnter"; "childMouseLeave": "childMouseLeave"; }, never, never, false, never>;
1700
1723
  }
1701
1724
 
@@ -1728,11 +1751,9 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
1728
1751
  private cdr;
1729
1752
  isPreview: boolean;
1730
1753
  private overlayService;
1731
- private contentService;
1732
- private shopContentService;
1754
+ private dataSourceService;
1733
1755
  private dsRegistry;
1734
1756
  private panelEventService;
1735
- private activatedRoute;
1736
1757
  children: ComponentNode[];
1737
1758
  private _style;
1738
1759
  private _previewStyle;
@@ -1794,18 +1815,19 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
1794
1815
  editSwiperEl?: ElementRef<HTMLElement>;
1795
1816
  _swiper: any;
1796
1817
  private _initRafId;
1797
- private _orgId;
1798
1818
  private _bindingSub?;
1799
1819
  private instanceRegistry;
1800
1820
  private interactionEngine;
1801
1821
  private ngZone;
1802
- constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef, isPreview: boolean, overlayService: OverlayService, contentService: IoxContentService | null, shopContentService: IoxContentService | null, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, activatedRoute: ActivatedRoute);
1822
+ constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef, isPreview: boolean, overlayService: OverlayService, dataSourceService: BuilderDataSourceService | null, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService);
1803
1823
  ngOnInit(): void;
1804
1824
  ngAfterViewInit(): void;
1805
1825
  ngOnChanges(changes: SimpleChanges): void;
1806
1826
  ngOnDestroy(): void;
1807
1827
  trackByNodeId(_index: number, node: ComponentNode): string;
1808
1828
  onDrop(event: IoxDropEvent): void;
1829
+ /** Slides come from the SHARED resolver (public controllers + the source's own filters) — the
1830
+ * same decision the SSR engine runs, so the canvas preview matches the published page. */
1809
1831
  private fetchData;
1810
1832
  private refreshPreviews;
1811
1833
  private applyFirstItemToTemplate;
@@ -1815,7 +1837,7 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
1815
1837
  private _initSwiper;
1816
1838
  private _destroySwiper;
1817
1839
  private _onSwiperEvent;
1818
- static ɵfac: i0.ɵɵFactoryDeclaration<SliderContainerComponent, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
1840
+ static ɵfac: i0.ɵɵFactoryDeclaration<SliderContainerComponent, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
1819
1841
  static ɵcmp: i0.ɵɵComponentDeclaration<SliderContainerComponent, "app-slider-container", never, { "children": { "alias": "children"; "required": false; }; "style": { "alias": "style"; "required": false; }; "nodeId": { "alias": "nodeId"; "required": false; }; "dropListId": { "alias": "dropListId"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "slidesPerView": { "alias": "slidesPerView"; "required": false; }; "slidesPerGroup": { "alias": "slidesPerGroup"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "centeredSlides": { "alias": "centeredSlides"; "required": false; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; }; "initialSlide": { "alias": "initialSlide"; "required": false; }; "autoHeight": { "alias": "autoHeight"; "required": false; }; "grabCursor": { "alias": "grabCursor"; "required": false; }; "slideToClickedSlide": { "alias": "slideToClickedSlide"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "speed": { "alias": "speed"; "required": false; }; "enableNavigation": { "alias": "enableNavigation"; "required": false; }; "navigationColor": { "alias": "navigationColor"; "required": false; }; "navigationSize": { "alias": "navigationSize"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "paginationColor": { "alias": "paginationColor"; "required": false; }; "paginationType": { "alias": "paginationType"; "required": false; }; "paginationClickable": { "alias": "paginationClickable"; "required": false; }; "paginationDynamicBullets": { "alias": "paginationDynamicBullets"; "required": false; }; "enableAutoplay": { "alias": "enableAutoplay"; "required": false; }; "autoplayDelay": { "alias": "autoplayDelay"; "required": false; }; "autoplayPauseOnMouseEnter": { "alias": "autoplayPauseOnMouseEnter"; "required": false; }; "autoplayDisableOnInteraction": { "alias": "autoplayDisableOnInteraction"; "required": false; }; "enableScrollbar": { "alias": "enableScrollbar"; "required": false; }; "freeMode": { "alias": "freeMode"; "required": false; }; "enableKeyboard": { "alias": "enableKeyboard"; "required": false; }; "enableMousewheel": { "alias": "enableMousewheel"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "enableParallax": { "alias": "enableParallax"; "required": false; }; "enableGrid": { "alias": "enableGrid"; "required": false; }; "gridRows": { "alias": "gridRows"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "source": { "alias": "source"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; }, { "childClick": "childClick"; "childMouseEnter": "childMouseEnter"; "childMouseLeave": "childMouseLeave"; }, never, never, false, never>;
1820
1842
  }
1821
1843
 
@@ -2022,6 +2044,24 @@ declare class BuilderHistoryService {
2022
2044
  static ɵprov: i0.ɵɵInjectableDeclaration<BuilderHistoryService>;
2023
2045
  }
2024
2046
 
2047
+ /**
2048
+ * Canvas data preview used to come from host-provided content services (IOX_CONTENT_SERVICE /
2049
+ * IOX_SHOP_SERVICE), whose `getContent(contentType, orgId)` hit the ADMIN resources endpoint and
2050
+ * accepted no filters — so the Repeater/Slider ignored every data-source filter. Data now flows
2051
+ * through BuilderDataSourceService + the shared planDataSource, configured with
2052
+ * IOX_DATA_SOURCE_ENDPOINTS. Those tokens are gone; do not reintroduce a fetch that bypasses it.
2053
+ */
2054
+ /** Optional font manager. Provide from the host app to populate the fontFamily dropdown. */
2055
+ declare const IOX_FONT_MANAGER: InjectionToken<IoxFontManager>;
2056
+ interface IoxFontManager {
2057
+ loadFonts(orgId: string): void;
2058
+ uploadedFonts$: rxjs.Observable<any>;
2059
+ getAllFontOptions(): {
2060
+ label: string;
2061
+ value: string;
2062
+ }[];
2063
+ }
2064
+
2025
2065
  declare class BuilderButtonComponentConfig extends ComponentConfig {
2026
2066
  constructor();
2027
2067
  }
@@ -2095,5 +2135,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
2095
2135
  constructor();
2096
2136
  }
2097
2137
 
2098
- export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DataSourceType, DeviceMode, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, IOX_SHOP_SERVICE, InteractionEngineService, InteractionPresetRegistryService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SymbolRegistryService, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildFullStyleTraits, buildPresetStyleTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
2099
- export type { BuilderClipboard, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, DeviceOption, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, HistoryEntry, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxContentService, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, ViewportState, ZoomOption };
2138
+ export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DataSourceType, DeviceMode, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SymbolRegistryService, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildFullStyleTraits, buildPresetStyleTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
2139
+ export type { BuilderClipboard, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, DeviceOption, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, HistoryEntry, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, ViewportState, ZoomOption };