@vectoriox/iox-builder 4.19.0 → 4.20.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
@@ -234,7 +234,7 @@ interface InteractionPreset {
234
234
  name: string;
235
235
  interactions: IoxInteraction[];
236
236
  }
237
- type ElementState = 'hover' | 'active' | 'focus' | 'first-child' | 'last-child' | 'nth-child(odd)' | 'nth-child(even)' | 'parent-hover' | 'trigger-hover';
237
+ type ElementState = 'hover' | 'active' | 'focus' | 'first-child' | 'last-child' | 'nth-child(odd)' | 'nth-child(even)' | 'parent-hover' | 'trigger-hover' | 'wrong' | 'accepted';
238
238
  /** Interaction pseudo-classes — compiled to .iox-node-{id}:state */
239
239
  declare const INTERACTION_STATES: ElementState[];
240
240
  /** Structural pseudo-classes — compiled to .iox-outer-{id}:state */
@@ -260,6 +260,16 @@ declare const RELATIONAL_STATE_BASE: Partial<Record<ElementState, string>>;
260
260
  */
261
261
  declare const TARGETED_STATES: ElementState[];
262
262
  declare const TARGETED_STATE_BASE: Partial<Record<ElementState, string>>;
263
+ /**
264
+ * Design-time validation states (forms-and-inputs-plan.md Part 2, board 7 — "the failure
265
+ * design"). Not real CSS pseudo-classes: `IoxFieldComponent` already carries `.iox-invalid`/
266
+ * `.iox-valid` host classes it sets from `forceInvalid`/`showValid` (decision D5), so authoring
267
+ * "Wrong"/"Accepted" styles compiles to a CLASS-compound selector, not `:state`. Currently only
268
+ * meaningful on Field (or any future component with the same host classes).
269
+ */
270
+ declare const VALIDATION_STATES: ElementState[];
271
+ /** The host class each validation state maps to. */
272
+ declare const VALIDATION_STATE_CLASS: Partial<Record<ElementState, string>>;
263
273
  declare const SUPPORTED_STATES: ElementState[];
264
274
  interface ComponentNode {
265
275
  id?: string;
@@ -301,6 +311,18 @@ interface ComponentNode {
301
311
  * appear in the trigger picker.
302
312
  */
303
313
  stateTriggers?: Partial<Record<ElementState, string>>;
314
+ /**
315
+ * Per-PART style overrides for a compound component (board 7 — "the failure design"). Keyed
316
+ * by the part's key (e.g. Field's `label`/`control`/`help`/`error`/`required`); the whole
317
+ * node's own base styling is unaffected and keeps using `styleTraits`/`stateStyles` directly
318
+ * — there is no `'whole'` entry here. Each part's `stateStyles` reuses the SAME `ElementState`
319
+ * union as the node itself, so a part can vary by hover/wrong/accepted/etc. Compiled via
320
+ * `buildPartSelector` (`@vectoriox/iox-ui`) — no new compiler, no second code path.
321
+ */
322
+ partStyles?: Record<string, {
323
+ styleProps?: Record<string, any>;
324
+ stateStyles?: Partial<Record<ElementState, Record<string, any>>>;
325
+ }>;
304
326
  /**
305
327
  * Per-breakpoint overrides — SPARSE, shaped like `stateStyles`:
306
328
  * `{ mobile: { styleProps: {…}, stateStyles: { hover: {…} } } }`. Base styles stay in
@@ -400,6 +422,17 @@ interface StyleTraitGroup {
400
422
  category: string;
401
423
  traits: ComponentTrait[];
402
424
  }
425
+ /**
426
+ * One styleable sub-element of a compound component (board 7 — "the failure design"). `key`
427
+ * identifies it in `ComponentNode.partStyles`; `className` is the stable class the component's
428
+ * OWN template already renders (e.g. `IoxFieldComponent`'s `iox-field__error`) — the part
429
+ * mechanism styles what already exists, it does not invent new markup.
430
+ */
431
+ interface StylePart {
432
+ key: string;
433
+ label: string;
434
+ className: string;
435
+ }
403
436
  declare function generateNodeId(): string;
404
437
  declare class ComponentConfig {
405
438
  id: string;
@@ -422,6 +455,9 @@ declare class ComponentConfig {
422
455
  /** Imperative methods this component exposes that can be used as interaction actions.
423
456
  * The Interactions panel appends these to the action dropdown when targeting this component. */
424
457
  componentMethods?: ComponentMethodDef[];
458
+ /** Styleable sub-elements (board 7). Absent/empty means no piece selector shows in the Style
459
+ * panel — most components have no addressable descendant, so this stays opt-in. */
460
+ parts?: StylePart[];
425
461
  constructor(type: string, selector: string, icon?: string, category?: string);
426
462
  /** Override specific trait defaults after styleTraits are set.
427
463
  * Call this at the end of each subclass constructor. */
@@ -1071,6 +1107,16 @@ declare class StyleRegistryService {
1071
1107
  * pseudo-class drives the state. Compiles a `:has()`-scoped selector.
1072
1108
  */
1073
1109
  upsert(nodeId: string, styles: Record<string, any>, state?: ElementState, relativeToId?: string, triggerId?: string): void;
1110
+ /**
1111
+ * Write or clear the styles for one PART of a compound component (board 7 — "the failure
1112
+ * design"), optionally further scoped to a validation state ('wrong'/'accepted'). Compiles
1113
+ * through the exact same `compile()` every other rule uses — `buildPartSelector` (shared,
1114
+ * `@vectoriox/iox-ui`) just builds a different selector string. Unlike interaction/relational/
1115
+ * targeted states, a validation state compounds a CLASS onto the node (`.iox-invalid`), not a
1116
+ * `:pseudo-class`, since `IoxFieldComponent` sets that class itself from `forceInvalid`/
1117
+ * `showValid` — there is no real "wrong" pseudo-class to hook.
1118
+ */
1119
+ upsertPart(nodeId: string, partClassName: string, styles: Record<string, any>, state?: ElementState): void;
1074
1120
  /**
1075
1121
  * Emit (or clear) a node's breakpoint rules. `planResponsiveRules` — shared with the SSR engine —
1076
1122
  * decides what each breakpoint emits; this only turns it into selectors, through the SAME
@@ -1957,6 +2003,9 @@ declare class RenderDirective implements OnInit, OnDestroy {
1957
2003
  private childSubs;
1958
2004
  /** Host element drag was registered on (collapsed path) — unregistered on destroy. */
1959
2005
  private hostDragEl;
2006
+ /** type -> its declared parts (board 7), cached so partClassNameFor doesn't instantiate a
2007
+ * fresh ComponentConfig on every render — same precedent as the layer tree's own icon cache. */
2008
+ private static readonly partsCache;
1960
2009
  constructor(vcr: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector, doc: Document, registryService: ComponentRegistryService, overlayService: OverlayService, styleRegistry: StyleRegistryService, interactionEngine: InteractionEngineService, cdr: ChangeDetectorRef, panelEventService: PanelEventService, dragEngine: DragEngineService);
1961
2010
  /**
1962
2011
  * Tag for a variable-tag directive-host (whose selector lists several tags, so
@@ -1976,6 +2025,9 @@ declare class RenderDirective implements OnInit, OnDestroy {
1976
2025
  * registry — at state-restore time the parent isn't registered yet, since it registers only
1977
2026
  * AFTER rendering its children). Used to key relational (parent-hover) rules. (issue #1)
1978
2027
  */
2028
+ /** The stable class a declared part compiles against, e.g. ('Field', 'error') -> 'iox-field__error'.
2029
+ * Undefined when the type declares no such part (or no parts at all) — caller skips it. */
2030
+ private partClassNameFor;
1979
2031
  private resolveParentNodeId;
1980
2032
  /** Nearest ANCESTOR of the styled element that is a registered iox-node AND contains the trigger
1981
2033
  * element — i.e. the DOM equivalent of `nearestCommonAncestorId`, resolved per rendered instance.
@@ -3080,6 +3132,14 @@ declare class GalleryConfig extends ComponentConfig {
3080
3132
  constructor();
3081
3133
  }
3082
3134
 
3135
+ /**
3136
+ * Field's styleable sub-elements (board 7 — "the failure design"). Class names match
3137
+ * `IoxFieldComponent`'s own template exactly (`@vectoriox/iox-ui`) — the part mechanism styles
3138
+ * what that component already renders, it does not invent new markup. "Whole field" (the node's
3139
+ * own base styling) is not listed here — the Style panel always offers it as the implicit first
3140
+ * choice, falling back to the node's ordinary `styleTraits`.
3141
+ */
3142
+ declare const FIELD_PARTS: StylePart[];
3083
3143
  /**
3084
3144
  * Form — the container that scopes its fields by ANCESTRY (decision D1).
3085
3145
  *
@@ -3175,5 +3235,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3175
3235
  constructor();
3176
3236
  }
3177
3237
 
3178
- 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, 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, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, 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, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, 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, stackChildrenProps, summarise, visibilityProps, wrapNode };
3179
- export type { AuditFinding, AuditNode, BreakpointPresentation, BuilderClipboard, BuilderLabelResolver, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, CreateConfig, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, 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, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, TreePathNode, ViewportState, ZoomOption };
3238
+ 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, 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, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, 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, 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, stackChildrenProps, summarise, visibilityProps, wrapNode };
3239
+ export type { AuditFinding, AuditNode, BreakpointPresentation, BuilderClipboard, BuilderLabelResolver, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, CreateConfig, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, 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 };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "4.19.0",
3
+ "version": "4.20.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.24.0",
9
+ "@vectoriox/iox-ui": ">=4.41.0",
10
10
  "interactjs": "^1.10.27",
11
11
  "primeng": ">=20.0.0",
12
12
  "swiper": ">=12.0.0",