@vectoriox/iox-builder 4.1.2 → 4.3.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
|
@@ -2576,6 +2576,120 @@ declare function findParentOf<T extends TreePathNode>(roots: readonly T[] | null
|
|
|
2576
2576
|
*/
|
|
2577
2577
|
declare function nodeAncestorPathInEither<T extends TreePathNode>(layout: readonly T[] | null | undefined, globalElements: readonly T[] | null | undefined, target: T | null | undefined): T[] | null;
|
|
2578
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
|
+
* ESSENTIALS (B3) — the handful of style controls that matter first for each component type.
|
|
2661
|
+
*
|
|
2662
|
+
* The style panel carries 94 controls across ten groups, ranked by nothing: the control you want for
|
|
2663
|
+
* a heading sits at the same visual weight as `backdrop-filter`. The panel shows this short list in
|
|
2664
|
+
* a band at the top; everything else stays exactly where it is, one click away, and reachable by
|
|
2665
|
+
* search. Nothing is removed and nothing changes group.
|
|
2666
|
+
*
|
|
2667
|
+
* A data table, not per-component code: adding a type is one row. Types with no row fall back to
|
|
2668
|
+
* `DEFAULT_ESSENTIAL_TRAITS`, so a new component is never worse off than today.
|
|
2669
|
+
*/
|
|
2670
|
+
declare const ESSENTIAL_TRAITS_BY_TYPE: Readonly<Record<string, readonly string[]>>;
|
|
2671
|
+
/** For any type without its own row — size, spacing and background suit almost anything. */
|
|
2672
|
+
declare const DEFAULT_ESSENTIAL_TRAITS: readonly string[];
|
|
2673
|
+
/** The essential trait NAMES for a component type, in the order they should be shown. */
|
|
2674
|
+
declare function essentialTraitsFor(type: string | null | undefined): readonly string[];
|
|
2675
|
+
/**
|
|
2676
|
+
* Does `label` or `name` match a control search? Case-insensitive substring on either, so "shadow"
|
|
2677
|
+
* finds `boxShadow` ("Box shadow") and "radius" finds `borderRadius`.
|
|
2678
|
+
*/
|
|
2679
|
+
declare function matchesControlSearch(name: string, label: string, term: string): boolean;
|
|
2680
|
+
|
|
2681
|
+
/**
|
|
2682
|
+
* The text on the drop indicator's chip — "into Card grid · position 2 of 3" (B2).
|
|
2683
|
+
*
|
|
2684
|
+
* The most common drag failure is landing a node one level off and not noticing; naming the PARENT
|
|
2685
|
+
* and the slot makes the target unambiguous before the pointer is released.
|
|
2686
|
+
*
|
|
2687
|
+
* @param containerName The target container's label or type; blank / unknown → "the page".
|
|
2688
|
+
* @param index Insert index within the container (0-based).
|
|
2689
|
+
* @param childCount How many children it has now — the node being dropped makes `childCount + 1`.
|
|
2690
|
+
*/
|
|
2691
|
+
declare function dropTargetLabel(containerName: string | null | undefined, index: number, childCount: number): string;
|
|
2692
|
+
|
|
2579
2693
|
declare class BuilderButtonComponentConfig extends ComponentConfig {
|
|
2580
2694
|
constructor();
|
|
2581
2695
|
}
|
|
@@ -2664,5 +2778,5 @@ declare class TextBlockComponentConfig extends ComponentConfig {
|
|
|
2664
2778
|
constructor();
|
|
2665
2779
|
}
|
|
2666
2780
|
|
|
2667
|
-
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 };
|
|
2668
|
-
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 };
|
|
2781
|
+
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, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, 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, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, stackChildrenProps, visibilityProps, wrapNode };
|
|
2782
|
+
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 };
|