@vectoriox/iox-builder 4.19.0 → 4.21.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,20 @@ 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
+ * Defined in `@vectoriox/iox-ui` (`style-compiler/parts.ts`), not here — the SSR engine needs
271
+ * this exact mapping too and does not depend on iox-builder. Re-exported for every existing
272
+ * `@vectoriox/iox-builder` consumer, so nothing importing from here needs to change.
273
+ */
274
+ declare const VALIDATION_STATES: ElementState[];
275
+ /** The host class each validation state maps to. */
276
+ declare const VALIDATION_STATE_CLASS: Partial<Record<ElementState, string>>;
263
277
  declare const SUPPORTED_STATES: ElementState[];
264
278
  interface ComponentNode {
265
279
  id?: string;
@@ -301,6 +315,18 @@ interface ComponentNode {
301
315
  * appear in the trigger picker.
302
316
  */
303
317
  stateTriggers?: Partial<Record<ElementState, string>>;
318
+ /**
319
+ * Per-PART style overrides for a compound component (board 7 — "the failure design"). Keyed
320
+ * by the part's key (e.g. Field's `label`/`control`/`help`/`error`/`required`); the whole
321
+ * node's own base styling is unaffected and keeps using `styleTraits`/`stateStyles` directly
322
+ * — there is no `'whole'` entry here. Each part's `stateStyles` reuses the SAME `ElementState`
323
+ * union as the node itself, so a part can vary by hover/wrong/accepted/etc. Compiled via
324
+ * `buildPartSelector` (`@vectoriox/iox-ui`) — no new compiler, no second code path.
325
+ */
326
+ partStyles?: Record<string, {
327
+ styleProps?: Record<string, any>;
328
+ stateStyles?: Partial<Record<ElementState, Record<string, any>>>;
329
+ }>;
304
330
  /**
305
331
  * Per-breakpoint overrides — SPARSE, shaped like `stateStyles`:
306
332
  * `{ mobile: { styleProps: {…}, stateStyles: { hover: {…} } } }`. Base styles stay in
@@ -400,6 +426,17 @@ interface StyleTraitGroup {
400
426
  category: string;
401
427
  traits: ComponentTrait[];
402
428
  }
429
+ /**
430
+ * One styleable sub-element of a compound component (board 7 — "the failure design"). `key`
431
+ * identifies it in `ComponentNode.partStyles`; `className` is the stable class the component's
432
+ * OWN template already renders (e.g. `IoxFieldComponent`'s `iox-field__error`) — the part
433
+ * mechanism styles what already exists, it does not invent new markup.
434
+ */
435
+ interface StylePart {
436
+ key: string;
437
+ label: string;
438
+ className: string;
439
+ }
403
440
  declare function generateNodeId(): string;
404
441
  declare class ComponentConfig {
405
442
  id: string;
@@ -422,6 +459,9 @@ declare class ComponentConfig {
422
459
  /** Imperative methods this component exposes that can be used as interaction actions.
423
460
  * The Interactions panel appends these to the action dropdown when targeting this component. */
424
461
  componentMethods?: ComponentMethodDef[];
462
+ /** Styleable sub-elements (board 7). Absent/empty means no piece selector shows in the Style
463
+ * panel — most components have no addressable descendant, so this stays opt-in. */
464
+ parts?: StylePart[];
425
465
  constructor(type: string, selector: string, icon?: string, category?: string);
426
466
  /** Override specific trait defaults after styleTraits are set.
427
467
  * Call this at the end of each subclass constructor. */
@@ -1071,6 +1111,16 @@ declare class StyleRegistryService {
1071
1111
  * pseudo-class drives the state. Compiles a `:has()`-scoped selector.
1072
1112
  */
1073
1113
  upsert(nodeId: string, styles: Record<string, any>, state?: ElementState, relativeToId?: string, triggerId?: string): void;
1114
+ /**
1115
+ * Write or clear the styles for one PART of a compound component (board 7 — "the failure
1116
+ * design"), optionally further scoped to a validation state ('wrong'/'accepted'). Compiles
1117
+ * through the exact same `compile()` every other rule uses — `buildPartSelector` (shared,
1118
+ * `@vectoriox/iox-ui`) just builds a different selector string. Unlike interaction/relational/
1119
+ * targeted states, a validation state compounds a CLASS onto the node (`.iox-invalid`), not a
1120
+ * `:pseudo-class`, since `IoxFieldComponent` sets that class itself from `forceInvalid`/
1121
+ * `showValid` — there is no real "wrong" pseudo-class to hook.
1122
+ */
1123
+ upsertPart(nodeId: string, partClassName: string, styles: Record<string, any>, state?: ElementState): void;
1074
1124
  /**
1075
1125
  * Emit (or clear) a node's breakpoint rules. `planResponsiveRules` — shared with the SSR engine —
1076
1126
  * decides what each breakpoint emits; this only turns it into selectors, through the SAME
@@ -3080,6 +3130,14 @@ declare class GalleryConfig extends ComponentConfig {
3080
3130
  constructor();
3081
3131
  }
3082
3132
 
3133
+ /**
3134
+ * Field's styleable sub-elements (board 7 — "the failure design"), for the Style panel's picker.
3135
+ * Class names come from the SHARED `PART_CLASS_NAMES` (`@vectoriox/iox-ui`) — the same map the
3136
+ * SSR engine resolves a part's selector from — so the picker can never drift from what actually
3137
+ * gets compiled. "Whole field" (the node's own base styling) is not listed here — the Style panel
3138
+ * always offers it as the implicit first choice, falling back to the node's ordinary `styleTraits`.
3139
+ */
3140
+ declare const FIELD_PARTS: StylePart[];
3083
3141
  /**
3084
3142
  * Form — the container that scopes its fields by ANCESTRY (decision D1).
3085
3143
  *
@@ -3175,5 +3233,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3175
3233
  constructor();
3176
3234
  }
3177
3235
 
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 };
3236
+ 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 };
3237
+ 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.21.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",