@vectoriox/iox-builder 4.1.1 → 4.2.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
@@ -1468,6 +1468,8 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1468
1468
  /** Overrides per breakpoint for the selection (or the whole page when nothing is selected) —
1469
1469
  * the breakpoint bar's dots. A field recomputed on change, never a getter (OnPush input). */
1470
1470
  breakpointCounts: BreakpointCounts;
1471
+ /** Deadline for swallowing the canvas click that completes an overlay action. */
1472
+ private _ignoreCanvasClickUntil;
1471
1473
  activeZoom: number;
1472
1474
  activeScreenWidth: number;
1473
1475
  selectedItem: ComponentNode | null;
@@ -2574,6 +2576,98 @@ declare function findParentOf<T extends TreePathNode>(roots: readonly T[] | null
2574
2576
  */
2575
2577
  declare function nodeAncestorPathInEither<T extends TreePathNode>(layout: readonly T[] | null | undefined, globalElements: readonly T[] | null | undefined, target: T | null | undefined): T[] | null;
2576
2578
 
2579
+ /** Where a click-inserted element lands: the array it goes into and the index within it. */
2580
+ interface InsertTarget<T> {
2581
+ /** The live children array to splice into (a container's `children`, or the page root). */
2582
+ children: T[];
2583
+ index: number;
2584
+ /** The node that owns `children`, or `null` for the page root. */
2585
+ parent: T | null;
2586
+ }
2587
+ /**
2588
+ * Resolve where "click to insert" puts a new element, from the current selection — the rule the
2589
+ * components panel and the canvas "+" share (builder-usability-plan.md, B2):
2590
+ *
2591
+ * nothing selected → appended to the page root
2592
+ * a CONTAINER selected → appended INSIDE it (its last child)
2593
+ * a LEAF selected → inserted AFTER it, as its next sibling
2594
+ *
2595
+ * `isContainer` decides what can hold children — the builder passes "has a registered drop zone",
2596
+ * the same test a drag uses, so a click can never insert somewhere a drop couldn't.
2597
+ * A selection not found in `roots` (stale) falls back to appending to the root.
2598
+ */
2599
+ declare function resolveInsertTarget<T extends TreePathNode & {
2600
+ children?: T[] | null;
2601
+ }>(roots: T[], selected: T | null | undefined, isContainer: (node: T) => boolean): InsertTarget<T>;
2602
+
2603
+ /**
2604
+ * STRUCTURE OPS (A4) — the one-click layout changes people actually make at a narrow width, as pure
2605
+ * "what to write" functions. Each returns a flat style map the caller stores in the node's
2606
+ * `responsive[bp]` layer (or in the base styles at Base) through the shared `setOverride`.
2607
+ *
2608
+ * All of it is ordinary CSS the SSR engine already renders — there is no second tree and no
2609
+ * per-width HTML. See responsive-breakpoints-plan.md (D5).
2610
+ */
2611
+ type StyleMap = Record<string, any>;
2612
+ /**
2613
+ * Hide / show at a width. Hiding is `display: none` INSIDE that breakpoint's rules — the node stays
2614
+ * in the DOM and in the SSR output (one HTML document serves every width), so hidden content still
2615
+ * ships bytes and is still indexed. Showing again clears the override rather than guessing a value.
2616
+ *
2617
+ * @returns the props to write, or `null` meaning "clear the display override at this breakpoint".
2618
+ */
2619
+ declare function visibilityProps(hidden: boolean): StyleMap | null;
2620
+ /** True when this node is hidden by the resolved styles at some width. */
2621
+ declare function isHiddenAt(resolvedStyleProps: StyleMap | null | undefined): boolean;
2622
+ /**
2623
+ * Stack a container's children in one column — the most common mobile edit, and four separate
2624
+ * controls today (display, direction, wrap, columns). A grid becomes a single-column grid; anything
2625
+ * else becomes a column flex box.
2626
+ */
2627
+ declare function stackChildrenProps(resolvedStyleProps: StyleMap | null | undefined): StyleMap;
2628
+ /**
2629
+ * Collapse a grid to `count` columns (a flex row is stacked instead — it has no column track).
2630
+ * `count` is clamped to at least 1.
2631
+ */
2632
+ declare function collapseColumnsProps(resolvedStyleProps: StyleMap | null | undefined, count: number): StyleMap;
2633
+ /** How many equal columns a `repeat(N, …)` track list describes, or null when it isn't one. */
2634
+ declare function columnCountOf(resolvedStyleProps: StyleMap | null | undefined): number | null;
2635
+ /**
2636
+ * Make fixed pixel sizes fluid: `width: 520px` → `width: 100%` with the original kept as
2637
+ * `max-width`, so the element still never exceeds its designed size on a wide screen. `minWidth` in
2638
+ * px is dropped to 0 — it is what actually forces horizontal scrolling on a phone.
2639
+ *
2640
+ * @returns the props to write; EMPTY when there is nothing fixed to fluidise.
2641
+ */
2642
+ declare function fluidiseProps(resolvedStyleProps: StyleMap | null | undefined): StyleMap;
2643
+ /** True when `fluidiseProps` would change anything — drives the button's disabled state. */
2644
+ declare function canFluidise(resolvedStyleProps: StyleMap | null | undefined): boolean;
2645
+ /**
2646
+ * Reorder children AT ONE WIDTH using CSS `order`, leaving the tree — and so the DOM and
2647
+ * screen-reader order — untouched. Returns one value per child BY CHILD INDEX: the `order` it must
2648
+ * take, or `null` for "no override needed".
2649
+ *
2650
+ * Either every child gets an explicit `order` or none does: CSS defaults `order` to 0, so a partial
2651
+ * set would mix overridden children with unordered ones and read as an arbitrary interleave.
2652
+ *
2653
+ * @param count How many children there are.
2654
+ * @param from Index of the child being moved.
2655
+ * @param to Index it should occupy.
2656
+ */
2657
+ declare function reorderProps(count: number, from: number, to: number): Array<number | null>;
2658
+
2659
+ /**
2660
+ * The text on the drop indicator's chip — "into Card grid · position 2 of 3" (B2).
2661
+ *
2662
+ * The most common drag failure is landing a node one level off and not noticing; naming the PARENT
2663
+ * and the slot makes the target unambiguous before the pointer is released.
2664
+ *
2665
+ * @param containerName The target container's label or type; blank / unknown → "the page".
2666
+ * @param index Insert index within the container (0-based).
2667
+ * @param childCount How many children it has now — the node being dropped makes `childCount + 1`.
2668
+ */
2669
+ declare function dropTargetLabel(containerName: string | null | undefined, index: number, childCount: number): string;
2670
+
2577
2671
  declare class BuilderButtonComponentConfig extends ComponentConfig {
2578
2672
  constructor();
2579
2673
  }
@@ -2662,5 +2756,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
2662
2756
  constructor();
2663
2757
  }
2664
2758
 
2665
- export { ACTION_TYPE_OPTIONS, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, 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, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, 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, 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, buildFullStyleTraits, buildPresetStyleTraits, defaultPageSettings, findNodeLocation, findParentOf, flattenSchemaFields, generateNodeId, nodeAncestorPath, nodeAncestorPathInEither, resolveTraitControllerType, resolveTraitOptions, wrapNode };
2666
- export type { BreakpointPresentation, BuilderClipboard, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, HistoryEntry, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, PanelEvent, QuadSizeSegment, RouteAnimationPreset, ScreenWidthOption, SelectionBadge, StylePreset, StyleTrait, StyleTraitGroup, TraitOptionMap, TraitSelectOption, TraitShowCondition, TreePathNode, ViewportState, ZoomOption };
2759
+ export { ACTION_TYPE_OPTIONS, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, 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, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, 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, 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, buildFullStyleTraits, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultPageSettings, dropTargetLabel, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, stackChildrenProps, visibilityProps, wrapNode };
2760
+ export type { BreakpointPresentation, BuilderClipboard, ComponentEventDef, ComponentMethodDef, ComponentNode, ComponentTrait, Crumb, DragPayload, DsFilterByQueryParam, DsFilterByRouteParam, ElementState, HistoryEntry, InsertTarget, InteractionAction, InteractionActionType, InteractionPreset, InteractionTrigger, IoxBinding, IoxDataSource, IoxDropEvent, IoxFontManager, IoxInteraction, IoxSymbol, NodeRef, OverlayBoxModel, OverlayBoxSpacing, OverlayEntry, PageRouteAnimationSettings, PageScrollSettings, PageSettings, PageStyleSettings, 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.1.1",
3
+ "version": "4.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",