@vectoriox/iox-builder 4.17.1 → 4.18.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
@@ -722,6 +722,45 @@ 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
+ declare class FormStateService {
744
+ private readonly _overlay;
745
+ private readonly _state$;
746
+ readonly state$: rxjs.Observable<FormStateSnapshot>;
747
+ constructor(_overlay: OverlayService);
748
+ getSnapshot(): FormStateSnapshot;
749
+ /** Called whenever the selection changes. A different form (or none) resets to Idle — a
750
+ * visitor never lands on a form already showing someone else's Sent/Failed block. */
751
+ setTarget(formId: string | null): void;
752
+ /**
753
+ * Writes the state straight onto the live component instance — a VIEW state, never page
754
+ * data, so it must never be persisted (a saved page must not ship showing its own success
755
+ * message). Two input names on purpose: the canvas renders the container twin (`formState`)
756
+ * while the engine renders `IoxFormComponent` (`renderState`); `safeSetInput` drops whichever
757
+ * the rendered component doesn't declare, so this works on either path unbranched.
758
+ */
759
+ setState(form: ComponentNode, state: FormRenderState): void;
760
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormStateService, never>;
761
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormStateService>;
762
+ }
763
+
725
764
  declare enum PanelEventTypes {
726
765
  ELEMENT_SELECT = "elementselect",
727
766
  ELEMENT_DESELECT = "elementdeselect",
@@ -1574,6 +1613,7 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1574
1613
  private dragEngine;
1575
1614
  private dsRegistry;
1576
1615
  private viewportService;
1616
+ private formStateService;
1577
1617
  private interactionEngine;
1578
1618
  private interactionPresetRegistry;
1579
1619
  private clipboard;
@@ -1672,9 +1712,13 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1672
1712
  activeZoom: number;
1673
1713
  activeScreenWidth: number;
1674
1714
  selectedItem: ComponentNode | null;
1715
+ private _selectedPath;
1675
1716
  /** Root → selected node. Drives the breadcrumb bar. Recomputed on every selection
1676
- * change (never a getter — see `_emitElementSelect`). */
1677
- selectedPath: ComponentNode[];
1717
+ * change (never a getter — see `_emitElementSelect`). A setter, not a plain field, so
1718
+ * `FormStateService` learns about a form-context change wherever selection changes,
1719
+ * rather than every call site having to remember to say so itself. */
1720
+ get selectedPath(): ComponentNode[];
1721
+ set selectedPath(path: ComponentNode[]);
1678
1722
  isDragging: boolean;
1679
1723
  scrollThumbTop: number;
1680
1724
  scrollThumbHeight: number;
@@ -1708,12 +1752,6 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1708
1752
  private canvasContentHeight;
1709
1753
  handleToolbarModeChange(mode: BuilderMode): void;
1710
1754
  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
1755
  handleToolbarZoomChange(value: number | 'fit'): void;
1718
1756
  handleToolbarScreenWidthChange(width: number): void;
1719
1757
  get globalElementsBefore(): ComponentNode[];
@@ -1739,7 +1777,7 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1739
1777
  get canvasMinHeight(): number;
1740
1778
  private sub?;
1741
1779
  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);
1780
+ 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
1781
  ngOnInit(): void;
1744
1782
  ngOnChanges(changes: SimpleChanges): void;
1745
1783
  ngAfterViewInit(): void;
@@ -2170,16 +2208,8 @@ declare class ToolbarComponent {
2170
2208
  canRedo: boolean;
2171
2209
  isSaving: boolean;
2172
2210
  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
2211
  modeChange: EventEmitter<BuilderMode>;
2181
2212
  breakpointChange: EventEmitter<Breakpoint>;
2182
- formStateChange: EventEmitter<FormRenderState>;
2183
2213
  auditToggle: EventEmitter<void>;
2184
2214
  zoomChange: EventEmitter<number | "fit">;
2185
2215
  screenWidthChange: EventEmitter<number>;
@@ -2213,31 +2243,20 @@ declare class ToolbarComponent {
2213
2243
  selectMode(mode: BuilderMode): void;
2214
2244
  constructor(labels: BuilderLabelResolver);
2215
2245
  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
2246
  /**
2223
2247
  * Translate one of the builder's own chrome strings. Unprovided, the resolver returns the
2224
2248
  * English fallback from `BUILDER_CHROME_EN`, so the library still reads correctly standalone
2225
2249
  * and never renders a raw key.
2226
2250
  */
2227
2251
  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
2252
  get publishLabel(): string;
2233
- selectFormState(state: FormRenderState): void;
2234
2253
  onSliderChange(event: Event): void;
2235
2254
  toggleWidthPopover(event: Event): void;
2236
2255
  selectScreenWidth(width: number): void;
2237
2256
  toggleZoomPopover(event: Event): void;
2238
2257
  selectZoom(value: number | 'fit'): void;
2239
2258
  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>;
2259
+ 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
2260
  }
2242
2261
 
2243
2262
  /**
@@ -3141,5 +3160,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
3141
3160
  constructor();
3142
3161
  }
3143
3162
 
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 };
3163
+ 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 };
3164
+ 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.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",