@vectoriox/iox-builder 4.37.2 → 4.38.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, ComponentInstanceRegistryService, DataSourceEndpoints } from '@vectoriox/iox-ui';
4
+ import { ResponsiveOverrides, RelativeSourceSpec, Breakpoint, PageStyleSettings, FormRenderState, ComponentInstanceRegistryService, DataSourceEndpoints, PalettePreset } 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';
@@ -355,6 +355,14 @@ interface ComponentNode {
355
355
  /** ID of the org-level InteractionPreset applied to this node.
356
356
  * When set, node.interactions reflects the preset's interactions. */
357
357
  interactionPresetId?: string;
358
+ /**
359
+ * The element style this node wears (design-system plan §3b) — an id from `ELEMENT_STYLES`
360
+ * (`@vectoriox/iox-ui/design-core`). Written by the registry factory for a NEW node and by the
361
+ * Style panel's switch; the trait values it wrote live in `styleTraits`/`stateStyles` like any
362
+ * other. Serialised; additive; NO renderer reads it — it drives the panel row, Reset, adopt
363
+ * (DS7) and the AI composer.
364
+ */
365
+ elementStyle?: string;
358
366
  }
359
367
  /**
360
368
  * Build a full StyleTraitGroup[] schema populated with values from a flat
@@ -467,6 +475,12 @@ declare class ComponentConfig {
467
475
  /** Styleable sub-elements (board 7). Absent/empty means no piece selector shows in the Style
468
476
  * panel — most components have no addressable descendant, so this stays opt-in. */
469
477
  parts?: StylePart[];
478
+ /** The name the Components panel shows when it differs from `type` (ButtonBlock is "Button"). */
479
+ label?: string;
480
+ /** Written by `ComponentRegistryService.createConfig` (the default element style) — the
481
+ * config doubles as the new node, so these mirror `ComponentNode`. */
482
+ elementStyle?: string;
483
+ stateStyles?: Partial<Record<ElementState, Record<string, any>>>;
470
484
  constructor(type: string, selector: string, icon?: string, category?: string);
471
485
  /** Override specific trait defaults after styleTraits are set.
472
486
  * Call this at the end of each subclass constructor. */
@@ -877,7 +891,21 @@ declare class ComponentRegistryService {
877
891
  private components;
878
892
  getComponent(type: string): Type<any> | null;
879
893
  hasComponent(type: string): boolean;
894
+ /**
895
+ * A NEW element, born wearing its type's default element style (design-system plan §3e):
896
+ * the style's exact trait map goes into `styleTraits`, its hover/active/focus into
897
+ * `stateStyles`, its id into `elementStyle`. Flavor-independent — the look arrives through the
898
+ * org's tokens, so no pack is consulted here.
899
+ */
880
900
  createConfig(type: string): any | null;
901
+ /**
902
+ * The type's UNSTYLED config — constructor defaults only. For rebuilding a SAVED node (its own
903
+ * stored values decide its look; a pre-DS2 page must not silently adopt element styles) and as
904
+ * the baseline a switched-off style's traits fall back to.
905
+ */
906
+ createBaseConfig(type: string): any | null;
907
+ /** The unstyled base style map of a type — `switchElementStyle`'s baseline. */
908
+ baselineStyleProps(type: string): Record<string, unknown>;
881
909
  register(type: string, component: Type<any>, config: any): void;
882
910
  getAll(): {
883
911
  type: string;
@@ -1056,6 +1084,14 @@ declare class DragEngineService {
1056
1084
  * would read the editor window. Set on the frame in builder.component.scss.
1057
1085
  */
1058
1086
  declare const BUILDER_CANVAS_CONTAINER = "iox-canvas";
1087
+ /**
1088
+ * The class that carries the ORG's design tokens on the canvas. Tokens used to be declared on
1089
+ * `:root`, where they collided with the admin's own `--iox-*` chrome tokens (`accent`, `surface-2`,
1090
+ * `scrim`, `focus-ring`… — DS2 seeds all 161 Crisp rows, so the clash became universal and the
1091
+ * admin turned the studio's accent colour). Every surface that renders site content through this
1092
+ * registry — the canvas frame, the global-elements overlay, preview, specimens — wears this class.
1093
+ */
1094
+ declare const BUILDER_TOKEN_SCOPE_CLASS = "iox-token-scope";
1059
1095
  /**
1060
1096
  * StyleRegistryService — manages a single <style> tag for the builder canvas.
1061
1097
  *
@@ -1074,7 +1110,7 @@ declare const BUILDER_CANVAS_CONTAINER = "iox-canvas";
1074
1110
  * and compiled to `.iox-node-{id}:hover { … }` selectors.
1075
1111
  *
1076
1112
  * Design token variables are stored under the reserved key `__tokens__` and
1077
- * compiled to a `:root { … }` block prepended to all other rules.
1113
+ * compiled to a `.iox-token-scope { … }` block prepended to all other rules.
1078
1114
  *
1079
1115
  * Scoped to PageUiComponent.providers[] — one stylesheet per builder instance.
1080
1116
  */
@@ -1164,7 +1200,8 @@ declare class StyleRegistryService {
1164
1200
  */
1165
1201
  private nodeRuleCss;
1166
1202
  /**
1167
- * Write the org-level design token variables as a `:root { … }` block.
1203
+ * Write the org-level design token variables as a `.iox-token-scope { … }` block (see
1204
+ * BUILDER_TOKEN_SCOPE_CLASS — never `:root`, which the admin's chrome tokens own).
1168
1205
  * Token names should be CSS custom property names without the `--` prefix
1169
1206
  * (e.g., `{ 'iox-primary-color': '#cb9090' }`).
1170
1207
  * Pass an empty object to clear all tokens.
@@ -1446,11 +1483,24 @@ interface ViewportState {
1446
1483
  scale: number;
1447
1484
  }
1448
1485
  declare class ViewportService {
1486
+ /**
1487
+ * True once the scale is something the author chose (restored from storage, or set since) —
1488
+ * false while it is still the DEFAULT guessed below.
1489
+ *
1490
+ * ⚠️ That default used to be a flat 0.75 whatever the window, so on a 1600px screen the 1440
1491
+ * canvas came up 1080 wide inside a ~1026 slot and the page's own left and right edges were
1492
+ * clipped off on first paint. A zoom read-out of "75%" over a page with no visible boundary
1493
+ * tells the author nothing. The builder now fits the canvas to the room it actually has while
1494
+ * this is false, and never touches a remembered zoom. See `autoFitViewport()`.
1495
+ */
1496
+ private scaleIsExplicit;
1449
1497
  private state;
1450
1498
  private stateSubject;
1451
1499
  state$: rxjs.Observable<ViewportState>;
1452
1500
  getState(): ViewportState;
1453
1501
  getScale(): number;
1502
+ /** True when the current scale is this code's guess, not a zoom the author picked. */
1503
+ get scaleIsDefault(): boolean;
1454
1504
  /** Show (and edit) `bp`: the canvas takes that breakpoint's preview width and height. */
1455
1505
  setBreakpoint(bp: Breakpoint): void;
1456
1506
  setScale(scale: number): void;
@@ -1486,6 +1536,8 @@ declare class ViewportService {
1486
1536
  * matching breakpoint (Base / Tablet / Small), so old preferences carry over unchanged.
1487
1537
  */
1488
1538
  private loadFromStorage;
1539
+ /** A saved zoom is the author's choice and is restored; its absence leaves the guess flagged. */
1540
+ private restoreScale;
1489
1541
  static ɵfac: i0.ɵɵFactoryDeclaration<ViewportService, never>;
1490
1542
  static ɵprov: i0.ɵɵInjectableDeclaration<ViewportService>;
1491
1543
  }
@@ -1910,6 +1962,14 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1910
1962
  onBoardMouseDown(event: MouseEvent): void;
1911
1963
  onBoardMouseMove(event: MouseEvent): void;
1912
1964
  onBoardMouseUp(): void;
1965
+ /**
1966
+ * Scale the canvas so the WHOLE page frame fits the slot it is given.
1967
+ *
1968
+ * ⚠️ The gutter here must match `$canvas-inset` in the stylesheet, doubled. It said 20 while
1969
+ * the inset was 20px *per side*, so "Fit" left the frame 40px wider than `.preview-scroll`
1970
+ * can show and `overflow: hidden` ate the difference — the one button whose entire job is to
1971
+ * fit was clipping both edges of the page by 20px.
1972
+ */
1913
1973
  private autoFitViewport;
1914
1974
  selectPanel(panel: string): void;
1915
1975
  handleClick(event: any): void;
@@ -3184,6 +3244,26 @@ declare function buildFieldKindPreset(def: FieldKindDef, createConfig: CreateCon
3184
3244
  declare function textNode(content: string, createConfig: CreateConfig): ComponentNode | null;
3185
3245
  declare function setTrait(node: ComponentNode, name: string, value: any): void;
3186
3246
 
3247
+ /**
3248
+ * PALETTE PRESETS (design-system plan §6, DS2) — Card, Panel and Navigation bar are NOT component
3249
+ * types: each is a Container wearing an element style (the spec's `palettePresets`), plus the
3250
+ * layout that makes it read as one (a column, a space-between row) and, for the bar, a `<nav>`.
3251
+ * They sit beside the layout presets and insert by click or drag.
3252
+ */
3253
+ interface PalettePresetDef {
3254
+ id: string;
3255
+ name: string;
3256
+ icon: string;
3257
+ description: string;
3258
+ preset: PalettePreset;
3259
+ }
3260
+ declare const PALETTE_PRESET_DEFS: readonly PalettePresetDef[];
3261
+ /**
3262
+ * A fresh preset node: the type's NEW-element config (already wearing its own default style), moved
3263
+ * onto the preset's element style, then the preset's traits and layout styleProps on top.
3264
+ */
3265
+ declare function buildPalettePreset(def: PalettePresetDef, createConfig: (type: string) => ComponentNode | null): ComponentNode | null;
3266
+
3187
3267
  interface ConsentPreset {
3188
3268
  banner: ComponentNode;
3189
3269
  preferences: ComponentNode;
@@ -3373,5 +3453,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3373
3453
  constructor();
3374
3454
  }
3375
3455
 
3376
- export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, 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_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, 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, 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, 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 };
3377
- 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, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, SelectionBadge, StyleMap, StylePart, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, TreePathNode, ViewportState, ZoomOption };
3456
+ 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_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 };
3457
+ 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 };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "4.37.2",
3
+ "version": "4.38.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": ">=4.41.0",
9
+ "@vectoriox/iox-ui": ">=5.12.0",
10
10
  "interactjs": "^1.10.27",
11
11
  "primeng": ">=20.0.0",
12
12
  "swiper": ">=12.0.0",