@vectoriox/iox-builder 1.9.2 → 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,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 {
|
|
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",
|
|
@@ -49,13 +50,15 @@ interface DsFilterByRouteParam {
|
|
|
49
50
|
defaultId?: string;
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
|
-
* When mode=query: each entry
|
|
53
|
-
*
|
|
54
|
-
* `
|
|
53
|
+
* When mode=query: each entry filters a schema field, either from a URL query string key
|
|
54
|
+
* (e.g. ?status=active → field "status") or by a constant.
|
|
55
|
+
* `queryParam` OMITTED → constant filter: `defaultValue` is always the value.
|
|
56
|
+
* `queryParam` present → the URL value wins and `defaultValue` is the fallback (which is what the
|
|
57
|
+
* builder preview always uses — design time has no live query params).
|
|
55
58
|
*/
|
|
56
59
|
interface DsFilterByQueryParam {
|
|
57
60
|
field: string;
|
|
58
|
-
queryParam
|
|
61
|
+
queryParam?: string;
|
|
59
62
|
defaultValue?: string;
|
|
60
63
|
}
|
|
61
64
|
declare enum DataSourceType {
|
|
@@ -1636,32 +1639,53 @@ declare class BuilderLinkedContainerComponent implements OnInit, OnDestroy {
|
|
|
1636
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>;
|
|
1637
1640
|
}
|
|
1638
1641
|
|
|
1639
|
-
/**
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
declare const
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
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>;
|
|
1655
1681
|
}
|
|
1656
1682
|
|
|
1657
1683
|
declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
|
|
1658
1684
|
private dragEngine;
|
|
1659
1685
|
private overlayService;
|
|
1660
|
-
private
|
|
1661
|
-
private shopContentService;
|
|
1686
|
+
private dataSourceService;
|
|
1662
1687
|
private dsRegistry;
|
|
1663
1688
|
private panelEventService;
|
|
1664
|
-
private activatedRoute;
|
|
1665
1689
|
private cdr;
|
|
1666
1690
|
children: ComponentNode[];
|
|
1667
1691
|
style: {
|
|
@@ -1679,21 +1703,22 @@ declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
|
|
|
1679
1703
|
readonly refreshPreviewsBound: () => void;
|
|
1680
1704
|
private _source;
|
|
1681
1705
|
private _limit;
|
|
1682
|
-
private orgId;
|
|
1683
1706
|
private bindingSub?;
|
|
1684
1707
|
get source(): string;
|
|
1685
1708
|
set source(value: string);
|
|
1686
1709
|
get limit(): number;
|
|
1687
1710
|
set limit(value: number);
|
|
1688
|
-
constructor(dragEngine: DragEngineService, overlayService: OverlayService,
|
|
1711
|
+
constructor(dragEngine: DragEngineService, overlayService: OverlayService, dataSourceService: BuilderDataSourceService, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, cdr: ChangeDetectorRef);
|
|
1689
1712
|
ngOnInit(): void;
|
|
1690
1713
|
ngOnDestroy(): void;
|
|
1691
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. */
|
|
1692
1717
|
private fetchData;
|
|
1693
1718
|
private isInTemplate;
|
|
1694
1719
|
private refreshPreviews;
|
|
1695
1720
|
private applyFirstItemToTemplate;
|
|
1696
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BuilderRepeaterComponent,
|
|
1721
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BuilderRepeaterComponent, never>;
|
|
1697
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>;
|
|
1698
1723
|
}
|
|
1699
1724
|
|
|
@@ -1726,11 +1751,9 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
|
|
|
1726
1751
|
private cdr;
|
|
1727
1752
|
isPreview: boolean;
|
|
1728
1753
|
private overlayService;
|
|
1729
|
-
private
|
|
1730
|
-
private shopContentService;
|
|
1754
|
+
private dataSourceService;
|
|
1731
1755
|
private dsRegistry;
|
|
1732
1756
|
private panelEventService;
|
|
1733
|
-
private activatedRoute;
|
|
1734
1757
|
children: ComponentNode[];
|
|
1735
1758
|
private _style;
|
|
1736
1759
|
private _previewStyle;
|
|
@@ -1792,18 +1815,19 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
|
|
|
1792
1815
|
editSwiperEl?: ElementRef<HTMLElement>;
|
|
1793
1816
|
_swiper: any;
|
|
1794
1817
|
private _initRafId;
|
|
1795
|
-
private _orgId;
|
|
1796
1818
|
private _bindingSub?;
|
|
1797
1819
|
private instanceRegistry;
|
|
1798
1820
|
private interactionEngine;
|
|
1799
1821
|
private ngZone;
|
|
1800
|
-
constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef, isPreview: boolean, overlayService: OverlayService,
|
|
1822
|
+
constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef, isPreview: boolean, overlayService: OverlayService, dataSourceService: BuilderDataSourceService | null, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService);
|
|
1801
1823
|
ngOnInit(): void;
|
|
1802
1824
|
ngAfterViewInit(): void;
|
|
1803
1825
|
ngOnChanges(changes: SimpleChanges): void;
|
|
1804
1826
|
ngOnDestroy(): void;
|
|
1805
1827
|
trackByNodeId(_index: number, node: ComponentNode): string;
|
|
1806
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. */
|
|
1807
1831
|
private fetchData;
|
|
1808
1832
|
private refreshPreviews;
|
|
1809
1833
|
private applyFirstItemToTemplate;
|
|
@@ -1813,7 +1837,7 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
|
|
|
1813
1837
|
private _initSwiper;
|
|
1814
1838
|
private _destroySwiper;
|
|
1815
1839
|
private _onSwiperEvent;
|
|
1816
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SliderContainerComponent, [null, null, { 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; }]>;
|
|
1817
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>;
|
|
1818
1842
|
}
|
|
1819
1843
|
|
|
@@ -2020,6 +2044,24 @@ declare class BuilderHistoryService {
|
|
|
2020
2044
|
static ɵprov: i0.ɵɵInjectableDeclaration<BuilderHistoryService>;
|
|
2021
2045
|
}
|
|
2022
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
|
+
|
|
2023
2065
|
declare class BuilderButtonComponentConfig extends ComponentConfig {
|
|
2024
2066
|
constructor();
|
|
2025
2067
|
}
|
|
@@ -2093,5 +2135,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
|
|
|
2093
2135
|
constructor();
|
|
2094
2136
|
}
|
|
2095
2137
|
|
|
2096
|
-
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,
|
|
2097
|
-
export type { BuilderClipboard, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, DeviceOption, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, HistoryEntry, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding,
|
|
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 };
|