@vectoriox/iox-builder 4.17.1 → 4.18.1

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
@@ -722,6 +722,53 @@ declare class OverlayService {
722
722
  static ɵprov: i0.ɵɵInjectableDeclaration<OverlayService>;
723
723
  }
724
724
 
725
+ interface FormStateSnapshot {
726
+ /** The Form the selection currently sits inside, or null. Drives whether a form-state
727
+ * control (wherever one is hosted) shows at all. */
728
+ formId: string | null;
729
+ state: FormRenderState;
730
+ }
731
+ /**
732
+ * The form state switcher's OWN state — which form is in scope and which of its four states the
733
+ * canvas is showing — as a shared, injectable service, the same pattern `ViewportService` already
734
+ * uses for the current breakpoint. `BuilderComponent` pushes `setTarget()` whenever the selection
735
+ * changes; any consumer (the toolbar, or — per forms-and-inputs-plan.md board 3 — the Form's own
736
+ * panel) reads `state$` and calls `setState()`.
737
+ *
738
+ * ⚠️ Moved out of `BuilderComponent` itself: hosting BOTH the state and the reveal logic there
739
+ * meant only the toolbar could ever drive it. The toolbar's own switcher UI broke the header
740
+ * (`.form-state-bar` had no CSS rule — see forms-and-inputs-plan.md Part 2) and was, separately,
741
+ * the wrong home per board 3: the switcher belongs to the Form, not to global chrome.
742
+ *
743
+ * `setTarget` takes the real node, not just its id, and keeps it (privately) for `setState` to
744
+ * use — `OverlayService.getNodeRef` matches by REFERENCE, not id (a repeater clone shares its
745
+ * template's id), so a caller re-deriving "the current form" from an id alone could resolve the
746
+ * wrong instance. Every consumer of this service only ever needs the id for display; the node
747
+ * itself is this service's own business.
748
+ */
749
+ declare class FormStateService {
750
+ private readonly _overlay;
751
+ private readonly _state$;
752
+ readonly state$: rxjs.Observable<FormStateSnapshot>;
753
+ private _targetNode;
754
+ constructor(_overlay: OverlayService);
755
+ getSnapshot(): FormStateSnapshot;
756
+ /** Called whenever the selection changes. A different form (or none) resets to Idle — a
757
+ * visitor never lands on a form already showing someone else's Sent/Failed block. */
758
+ setTarget(form: ComponentNode | null): void;
759
+ /**
760
+ * Writes the state straight onto the live component instance for the CURRENT target (set via
761
+ * `setTarget`) — a VIEW state, never page data, so it must never be persisted (a saved page
762
+ * must not ship showing its own success message). Two input names on purpose: the canvas
763
+ * renders the container twin (`formState`) while the engine renders `IoxFormComponent`
764
+ * (`renderState`); `safeSetInput` drops whichever the rendered component doesn't declare, so
765
+ * this works on either path unbranched. A no-op when nothing is in scope.
766
+ */
767
+ setState(state: FormRenderState): void;
768
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormStateService, never>;
769
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormStateService>;
770
+ }
771
+
725
772
  declare enum PanelEventTypes {
726
773
  ELEMENT_SELECT = "elementselect",
727
774
  ELEMENT_DESELECT = "elementdeselect",
@@ -1574,6 +1621,7 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1574
1621
  private dragEngine;
1575
1622
  private dsRegistry;
1576
1623
  private viewportService;
1624
+ private formStateService;
1577
1625
  private interactionEngine;
1578
1626
  private interactionPresetRegistry;
1579
1627
  private clipboard;
@@ -1672,9 +1720,13 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1672
1720
  activeZoom: number;
1673
1721
  activeScreenWidth: number;
1674
1722
  selectedItem: ComponentNode | null;
1723
+ private _selectedPath;
1675
1724
  /** Root → selected node. Drives the breadcrumb bar. Recomputed on every selection
1676
- * change (never a getter — see `_emitElementSelect`). */
1677
- selectedPath: ComponentNode[];
1725
+ * change (never a getter — see `_emitElementSelect`). A setter, not a plain field, so
1726
+ * `FormStateService` learns about a form-context change wherever selection changes,
1727
+ * rather than every call site having to remember to say so itself. */
1728
+ get selectedPath(): ComponentNode[];
1729
+ set selectedPath(path: ComponentNode[]);
1678
1730
  isDragging: boolean;
1679
1731
  scrollThumbTop: number;
1680
1732
  scrollThumbHeight: number;
@@ -1708,12 +1760,6 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1708
1760
  private canvasContentHeight;
1709
1761
  handleToolbarModeChange(mode: BuilderMode): void;
1710
1762
  handleToolbarBreakpointChange(bp: Breakpoint): void;
1711
- /** The form the selection sits inside, or null. Drives the toolbar's contextual switcher. */
1712
- activeFormState: FormRenderState;
1713
- get formStateTarget(): string | null;
1714
- handleToolbarFormStateChange(state: FormRenderState): void;
1715
- /** The nearest Form ancestor of the selection (or the selection itself). */
1716
- private selectedFormNode;
1717
1763
  handleToolbarZoomChange(value: number | 'fit'): void;
1718
1764
  handleToolbarScreenWidthChange(width: number): void;
1719
1765
  get globalElementsBefore(): ComponentNode[];
@@ -1739,7 +1785,7 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1739
1785
  get canvasMinHeight(): number;
1740
1786
  private sub?;
1741
1787
  private registrySub?;
1742
- constructor(registry: ComponentRegistryService, overlayService: OverlayService, panelEventService: PanelEventService, dragEngine: DragEngineService, dsRegistry: DataSourceRegistryService, viewportService: ViewportService, interactionEngine: InteractionEngineService, interactionPresetRegistry: InteractionPresetRegistryService, clipboard: BuilderClipboardService, symbolRegistry: SymbolRegistryService, cdr: ChangeDetectorRef, appRef: ApplicationRef, moveableCanvas: MoveableCanvasService, selectoCanvas: SelectoCanvasService, styleRegistry: StyleRegistryService);
1788
+ constructor(registry: ComponentRegistryService, overlayService: OverlayService, panelEventService: PanelEventService, dragEngine: DragEngineService, dsRegistry: DataSourceRegistryService, viewportService: ViewportService, formStateService: FormStateService, interactionEngine: InteractionEngineService, interactionPresetRegistry: InteractionPresetRegistryService, clipboard: BuilderClipboardService, symbolRegistry: SymbolRegistryService, cdr: ChangeDetectorRef, appRef: ApplicationRef, moveableCanvas: MoveableCanvasService, selectoCanvas: SelectoCanvasService, styleRegistry: StyleRegistryService);
1743
1789
  ngOnInit(): void;
1744
1790
  ngOnChanges(changes: SimpleChanges): void;
1745
1791
  ngAfterViewInit(): void;
@@ -2170,16 +2216,8 @@ declare class ToolbarComponent {
2170
2216
  canRedo: boolean;
2171
2217
  isSaving: boolean;
2172
2218
  pageStatus: string;
2173
- /**
2174
- * The form the selection sits inside, or null. CONTEXTUAL: the state switcher only appears when
2175
- * there is a form to switch, because a permanently-present control for a rarely-present element
2176
- * is exactly the toolbar clutter `builder-usability-plan.md` warns about.
2177
- */
2178
- formStateTarget: string | null;
2179
- activeFormState: FormRenderState;
2180
2219
  modeChange: EventEmitter<BuilderMode>;
2181
2220
  breakpointChange: EventEmitter<Breakpoint>;
2182
- formStateChange: EventEmitter<FormRenderState>;
2183
2221
  auditToggle: EventEmitter<void>;
2184
2222
  zoomChange: EventEmitter<number | "fit">;
2185
2223
  screenWidthChange: EventEmitter<number>;
@@ -2213,31 +2251,20 @@ declare class ToolbarComponent {
2213
2251
  selectMode(mode: BuilderMode): void;
2214
2252
  constructor(labels: BuilderLabelResolver);
2215
2253
  selectBreakpoint(bp: Breakpoint): void;
2216
- /** The four states, in the order a submission moves through them. */
2217
- readonly formStates: {
2218
- id: FormRenderState;
2219
- labelKey: string;
2220
- icon: string;
2221
- }[];
2222
2254
  /**
2223
2255
  * Translate one of the builder's own chrome strings. Unprovided, the resolver returns the
2224
2256
  * English fallback from `BUILDER_CHROME_EN`, so the library still reads correctly standalone
2225
2257
  * and never renders a raw key.
2226
2258
  */
2227
2259
  t(key: string): string;
2228
- /** "Show the form's Success state" — one key with a slot, not four sentences to translate. */
2229
- formStateHint(state: {
2230
- labelKey: string;
2231
- }): string;
2232
2260
  get publishLabel(): string;
2233
- selectFormState(state: FormRenderState): void;
2234
2261
  onSliderChange(event: Event): void;
2235
2262
  toggleWidthPopover(event: Event): void;
2236
2263
  selectScreenWidth(width: number): void;
2237
2264
  toggleZoomPopover(event: Event): void;
2238
2265
  selectZoom(value: number | 'fit'): void;
2239
2266
  static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
2240
- static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "app-toolbar", never, { "activeMode": { "alias": "activeMode"; "required": false; }; "activeBreakpoint": { "alias": "activeBreakpoint"; "required": false; }; "breakpointCounts": { "alias": "breakpointCounts"; "required": false; }; "auditCount": { "alias": "auditCount"; "required": false; }; "auditOpen": { "alias": "auditOpen"; "required": false; }; "activeZoom": { "alias": "activeZoom"; "required": false; }; "activeScreenWidth": { "alias": "activeScreenWidth"; "required": false; }; "canUndo": { "alias": "canUndo"; "required": false; }; "canRedo": { "alias": "canRedo"; "required": false; }; "isSaving": { "alias": "isSaving"; "required": false; }; "pageStatus": { "alias": "pageStatus"; "required": false; }; "formStateTarget": { "alias": "formStateTarget"; "required": false; }; "activeFormState": { "alias": "activeFormState"; "required": false; }; }, { "modeChange": "modeChange"; "breakpointChange": "breakpointChange"; "formStateChange": "formStateChange"; "auditToggle": "auditToggle"; "zoomChange": "zoomChange"; "screenWidthChange": "screenWidthChange"; "undo": "undo"; "redo": "redo"; "save": "save"; "preview": "preview"; "publishToggle": "publishToggle"; }, never, never, false, never>;
2267
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "app-toolbar", never, { "activeMode": { "alias": "activeMode"; "required": false; }; "activeBreakpoint": { "alias": "activeBreakpoint"; "required": false; }; "breakpointCounts": { "alias": "breakpointCounts"; "required": false; }; "auditCount": { "alias": "auditCount"; "required": false; }; "auditOpen": { "alias": "auditOpen"; "required": false; }; "activeZoom": { "alias": "activeZoom"; "required": false; }; "activeScreenWidth": { "alias": "activeScreenWidth"; "required": false; }; "canUndo": { "alias": "canUndo"; "required": false; }; "canRedo": { "alias": "canRedo"; "required": false; }; "isSaving": { "alias": "isSaving"; "required": false; }; "pageStatus": { "alias": "pageStatus"; "required": false; }; }, { "modeChange": "modeChange"; "breakpointChange": "breakpointChange"; "auditToggle": "auditToggle"; "zoomChange": "zoomChange"; "screenWidthChange": "screenWidthChange"; "undo": "undo"; "redo": "redo"; "save": "save"; "preview": "preview"; "publishToggle": "publishToggle"; }, never, never, false, never>;
2241
2268
  }
2242
2269
 
2243
2270
  /**
@@ -3141,5 +3168,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3141
3168
  constructor();
3142
3169
  }
3143
3170
 
3144
- 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, 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 };
3145
- export type { AuditFinding, AuditNode, BreakpointPresentation, BuilderClipboard, BuilderLabelResolver, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, CreateConfig, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, FormPresetDef, FormPresetField, 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 };
3171
+ 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 };
3172
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "4.17.1",
3
+ "version": "4.18.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",