@vectoriox/iox-builder 1.2.9 → 1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "1.2.9",
3
+ "version": "1.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -118,6 +118,8 @@ interface StylePreset {
118
118
  /** Flat CSS property map — same shape as IoxLayoutNode.styleProps. */
119
119
  styleProps: Record<string, any>;
120
120
  }
121
+ type ElementState = 'hover' | 'active' | 'focus';
122
+ declare const SUPPORTED_STATES: ElementState[];
121
123
  interface ComponentNode {
122
124
  id?: string;
123
125
  /**
@@ -144,6 +146,12 @@ interface ComponentNode {
144
146
  * Absent when no preset is applied (full styles stored in styleTraits instead).
145
147
  */
146
148
  styleOverrides?: Record<string, any>;
149
+ /**
150
+ * Per-state style overrides. Only stores properties that differ from the base
151
+ * style — same sparse pattern as styleOverrides. Each key maps to a flat CSS
152
+ * property map that is compiled to `.iox-node-{id}:hover { … }` etc.
153
+ */
154
+ stateStyles?: Partial<Record<ElementState, Record<string, any>>>;
147
155
  }
148
156
  /**
149
157
  * Build a full StyleTraitGroup[] schema populated with values from a flat
@@ -162,7 +170,8 @@ declare enum TraitInputType {
162
170
  Scrub = "scrub",
163
171
  Icon = "icon",
164
172
  Media = "media",
165
- FontFamily = "fontFamily"
173
+ FontFamily = "fontFamily",
174
+ GridTemplate = "gridTemplate"
166
175
  }
167
176
  interface TraitOptionMap {
168
177
  [key: string]: any;
@@ -779,6 +788,12 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
779
788
  * space — it does not push sibling elements. Applying margin to the host element
780
789
  * (which IS the flex/block child in the parent container) makes it work correctly.
781
790
  *
791
+ * State styles (hover/active/focus) are stored under key `${nodeId}:${state}`
792
+ * and compiled to `.iox-node-{id}:hover { … }` selectors.
793
+ *
794
+ * Design token variables are stored under the reserved key `__tokens__` and
795
+ * compiled to a `:root { … }` block prepended to all other rules.
796
+ *
782
797
  * Scoped to PageUiComponent.providers[] — one stylesheet per builder instance.
783
798
  */
784
799
  declare class StyleRegistryService {
@@ -788,7 +803,23 @@ declare class StyleRegistryService {
788
803
  /** Properties that must live on the wrapper element to affect the parent layout. */
789
804
  private static readonly OUTER_PROPS;
790
805
  init(): void;
791
- upsert(nodeId: string, styles: Record<string, any>): void;
806
+ /**
807
+ * Write or update the base styles for a node, or a pseudo-class state override.
808
+ *
809
+ * @param nodeId The node's CSS id (used in `.iox-node-{nodeId}`)
810
+ * @param styles Flat CSS property map (camelCase keys)
811
+ * @param state Optional pseudo-class state ('hover' | 'active' | 'focus').
812
+ * When provided, compiles to `.iox-node-{id}:{state} { … }`.
813
+ * State rules are NOT partitioned into inner/outer.
814
+ */
815
+ upsert(nodeId: string, styles: Record<string, any>, state?: 'hover' | 'active' | 'focus'): void;
816
+ /**
817
+ * Write the org-level design token variables as a `:root { … }` block.
818
+ * Token names should be CSS custom property names without the `--` prefix
819
+ * (e.g., `{ 'iox-primary-color': '#cb9090' }`).
820
+ * Pass an empty object to clear all tokens.
821
+ */
822
+ upsertTokens(tokens: Record<string, string>): void;
792
823
  remove(nodeId: string): void;
793
824
  destroy(): void;
794
825
  private compile;
@@ -1338,5 +1369,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
1338
1369
  constructor();
1339
1370
  }
1340
1371
 
1341
- export { ACTION_TYPE_OPTIONS, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
1342
- export type { ComponentNode, ComponentTrait, DeviceOption, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, InteractionAction, InteractionActionType, InteractionTrigger, IoxBinding, IoxContentService, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, ViewportState, ZoomOption };
1372
+ export { ACTION_TYPE_OPTIONS, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
1373
+ export type { ComponentNode, ComponentTrait, DeviceOption, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, InteractionAction, InteractionActionType, InteractionTrigger, IoxBinding, IoxContentService, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, ViewportState, ZoomOption };