@vectoriox/iox-builder 5.1.1 → 5.3.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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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 i30 from '@vectoriox/iox-ui';
4
- import { ResponsiveOverrides, RelativeSourceSpec, Breakpoint, PageStyleSettings, FormRenderState, DesignTokenLike, ComponentInstanceRegistryService, DataSourceEndpoints, PalettePreset } from '@vectoriox/iox-ui';
4
+ import { ResponsiveOverrides, RelativeSourceSpec, Breakpoint, PageStyleSettings, FormRenderState, DesignTokenLike, DesignMode, ComponentInstanceRegistryService, DataSourceEndpoints, PalettePreset, syncNodeDesignClasses } from '@vectoriox/iox-ui';
5
5
  export { ComponentInstanceRegistryService, IoxContextSlot, PageStyleSettings, SetContextParams, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
6
6
  import * as rxjs from 'rxjs';
7
7
  import { Subject, Subscription, BehaviorSubject, Observable } from 'rxjs';
@@ -1090,6 +1090,13 @@ declare const BUILDER_CANVAS_CONTAINER = "iox-canvas";
1090
1090
  * registry — the canvas frame, the global-elements overlay, preview, specimens — wears this class.
1091
1091
  */
1092
1092
  declare const BUILDER_TOKEN_SCOPE_CLASS = "iox-token-scope";
1093
+ /** Marks the Google font `<link>`s the canvas adds to `<head>` (one per family, design-system DS4). */
1094
+ declare const BUILDER_FONT_LINK_ATTR = "data-iox-font";
1095
+ /** What the canvas wears — the studio's colour mode (D6) beside its rows. */
1096
+ interface UpsertTokensOptions {
1097
+ /** `settings.design.mode`. Omitted = keep the mode last set (a Tokens-panel edit does not know it). */
1098
+ mode?: DesignMode;
1099
+ }
1093
1100
  /**
1094
1101
  * StyleRegistryService — manages a single <style> tag for the builder canvas.
1095
1102
  *
@@ -1129,6 +1136,8 @@ declare class StyleRegistryService {
1129
1136
  * positioning, an Icon's line-height) from EVERY rule of that node, whoever upserts it. */
1130
1137
  private nodeTypes;
1131
1138
  private tokenCss;
1139
+ private tokenRows;
1140
+ private tokenMode;
1132
1141
  private styleEl;
1133
1142
  /**
1134
1143
  * Properties that must live on the OUTER wrapper (.iox-outer-{id}) because they
@@ -1215,9 +1224,18 @@ declare class StyleRegistryService {
1215
1224
  * block, LAST. It used to be a hand-written copy that emitted variables and dark only.
1216
1225
  * Pass the full row set every time (an empty list clears).
1217
1226
  */
1218
- upsertTokens(tokens: ReadonlyArray<DesignTokenLike> | null | undefined): void;
1227
+ upsertTokens(tokens: ReadonlyArray<DesignTokenLike> | null | undefined, opts?: UpsertTokensOptions): void;
1228
+ /** The colour mode the canvas compiles in. */
1229
+ get mode(): DesignMode;
1219
1230
  remove(nodeId: string): void;
1220
1231
  destroy(): void;
1232
+ /**
1233
+ * The Google families the org's font tokens name — the SAME catalog and URL the SSR engine links
1234
+ * (design-core `fontsForTokens` / `googleFontHref`), one `<link>` per family. They only declare
1235
+ * @font-face, and only the canvas (`.iox-token-scope`) reads the font tokens, so the admin keeps
1236
+ * Poppins. Links stay for the session: a trial that switches back costs no refetch.
1237
+ */
1238
+ private loadTokenFonts;
1221
1239
  private compile;
1222
1240
  private _flushPending;
1223
1241
  private flush;
@@ -2342,8 +2360,10 @@ declare class OverlayComponent implements OnInit, OnDestroy {
2342
2360
  /**
2343
2361
  * True for nodes rendered on the EDITING canvas — provided by `BuilderComponent` at component level,
2344
2362
  * so it reaches every `[ioxRender]` under `<app-builder>` and nothing else (Preview renders the same
2345
- * directive outside it). Not `IS_PREVIEW`: the admin provides that one from an eagerly imported module,
2346
- * so it reads true everywhere, the canvas included.
2363
+ * directive outside it). It answers "is this the editor?" — the canvas-only "Add image" label hangs off
2364
+ * it. `IS_PREVIEW` answers the other question, "is this a preview/live render?" (links navigate,
2365
+ * sliders run live), and is provided ONLY by Preview (component level) and the engine; neither token
2366
+ * implies the other — a design sampler, for one, is neither.
2347
2367
  */
2348
2368
  declare const IOX_BUILDER_CANVAS: InjectionToken<boolean>;
2349
2369
  /** Optional font manager. Provide from the host app to populate the fontFamily dropdown. */
@@ -2376,6 +2396,14 @@ declare const defaultBuilderLabels: BuilderLabelResolver;
2376
2396
  * in one go rather than discovering keys one missing label at a time.
2377
2397
  */
2378
2398
  declare const BUILDER_CHROME_EN: Readonly<Record<string, string>>;
2399
+ declare const CANVAS_EMPTY_IMAGE_LABEL_KEY = "builder.chrome.addImage";
2400
+ declare const CANVAS_EMPTY_IMAGE_LABEL_EN: string;
2401
+ /**
2402
+ * Marks an element the builder draws on the canvas that the live site never has — drop placeholders,
2403
+ * repeat badges, the empty slider hint. A page thumbnail is a picture of the SITE, so its capture
2404
+ * leaves every marked element out.
2405
+ */
2406
+ declare const EDITOR_CHROME_ATTRIBUTE = "data-iox-chrome";
2379
2407
 
2380
2408
  declare class ToolbarComponent {
2381
2409
  private readonly labels;
@@ -2849,18 +2877,17 @@ declare class SliderContainerComponent implements OnInit, AfterViewInit, OnChang
2849
2877
  declare class SliderSlideComponent implements OnInit, OnDestroy {
2850
2878
  private dragEngine;
2851
2879
  private cdr;
2852
- isPreview: boolean;
2853
2880
  children: ComponentNode[];
2854
2881
  nodeId: string;
2855
2882
  dropListId: string;
2856
2883
  childClick: EventEmitter<any>;
2857
2884
  childMouseEnter: EventEmitter<any>;
2858
2885
  childMouseLeave: EventEmitter<void>;
2859
- constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef, isPreview: boolean);
2886
+ constructor(dragEngine: DragEngineService, cdr: ChangeDetectorRef);
2860
2887
  ngOnInit(): void;
2861
2888
  ngOnDestroy(): void;
2862
2889
  onDrop(event: IoxDropEvent): void;
2863
- static ɵfac: i0.ɵɵFactoryDeclaration<SliderSlideComponent, [null, null, { optional: true; }]>;
2890
+ static ɵfac: i0.ɵɵFactoryDeclaration<SliderSlideComponent, never>;
2864
2891
  static ɵcmp: i0.ɵɵComponentDeclaration<SliderSlideComponent, "app-slider-slide", never, { "children": { "alias": "children"; "required": false; }; "nodeId": { "alias": "nodeId"; "required": false; }; "dropListId": { "alias": "dropListId"; "required": false; }; }, { "childClick": "childClick"; "childMouseEnter": "childMouseEnter"; "childMouseLeave": "childMouseLeave"; }, never, never, false, never>;
2865
2892
  }
2866
2893
 
@@ -3314,6 +3341,23 @@ declare function nearestFormNode(path: readonly ComponentNode[] | null | undefin
3314
3341
  */
3315
3342
  declare function dropTargetLabel(containerName: string | null | undefined, index: number, childCount: number): string;
3316
3343
 
3344
+ type NodeDesign = Parameters<typeof syncNodeDesignClasses>[1];
3345
+ /** The editing canvas's "Add image" label, through the host's i18n. */
3346
+ declare function canvasEmptyImageLabel(labels: BuilderLabelResolver): string;
3347
+ /**
3348
+ * Push a node's empty-image placeholder (design-system DS3) to its rendered component — a no-op for
3349
+ * a component that declares no `emptySrc`. The placeholder depends on the MARKER only, never on the
3350
+ * source, so it is set once at render and again whenever the node's element style changes.
3351
+ */
3352
+ declare function syncEmptyImagePlaceholder(ref: ComponentRef<unknown> | null | undefined, node: NodeDesign, emptyLabel: string | null): void;
3353
+ /**
3354
+ * Everything a node's element style / colour scheme decides on its rendered host, in ONE call: the
3355
+ * design classes (marker + scheme) and the empty-image placeholder. Every place that switches or
3356
+ * resets a node's style on the canvas calls this, so an adopted Image gains its placeholder at once
3357
+ * instead of after a reload (DS3 D2).
3358
+ */
3359
+ declare function syncNodeDesign(ref: ComponentRef<unknown> | null | undefined, node: NodeDesign, emptyLabel: string | null): void;
3360
+
3317
3361
  /**
3318
3362
  * Dialog (actions plan A1b) — an ordinary container whose children are normal nodes, rendered
3319
3363
  * on the live site as a real `<dialog>` (top layer, free focus trap/Esc) and in the CANVAS as a
@@ -3463,5 +3507,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3463
3507
  constructor();
3464
3508
  }
3465
3509
 
3466
- export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_PRESETS, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PALETTE_PRESET_DEFS, 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, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildConsentPreset, buildFieldKindPreset, buildFlavorSampler, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, setTrait, stackChildrenProps, summarise, textNode, visibilityProps, wrapNode };
3467
- export type { AuditFinding, AuditNode, BreakpointPresentation, BuilderClipboard, BuilderLabelResolver, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, ConsentPreset, CreateConfig, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, FieldKindDef, FormPresetDef, FormPresetField, FormStateSnapshot, HistoryEntry, InsertTarget, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, LayoutPresetChildStyles, LayoutPresetDef, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PalettePresetDef, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, SelectionBadge, StyleMap, StylePart, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, TreePathNode, ViewportState, ZoomOption };
3510
+ export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_PRESETS, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PALETTE_PRESET_DEFS, 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, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildConsentPreset, buildFieldKindPreset, buildFlavorSampler, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, canFluidise, canvasEmptyImageLabel, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, setTrait, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, textNode, visibilityProps, wrapNode };
3511
+ export type { AuditFinding, AuditNode, BreakpointPresentation, BuilderClipboard, BuilderLabelResolver, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, ConsentPreset, CreateConfig, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, FieldKindDef, FormPresetDef, FormPresetField, FormStateSnapshot, HistoryEntry, InsertTarget, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, LayoutPresetChildStyles, LayoutPresetDef, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PalettePresetDef, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, SelectionBadge, StyleMap, StylePart, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, TreePathNode, UpsertTokensOptions, ViewportState, ZoomOption };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "5.1.1",
3
+ "version": "5.3.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
7
7
  "@angular/animations": ">=20.0.0",
8
8
  "@angular/cdk": ">=20.0.0",
9
- "@vectoriox/iox-ui": ">=5.14.0",
9
+ "@vectoriox/iox-ui": ">=5.16.0",
10
10
  "interactjs": "^1.10.27",
11
11
  "primeng": ">=20.0.0",
12
12
  "swiper": ">=12.0.0",