@vectoriox/iox-ui 4.22.0 → 4.24.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.
@@ -744,18 +744,33 @@ declare const SUPPRESSED_STYLE_PROPS_BY_TYPE: Readonly<Record<string, readonly s
744
744
  /** Remove the style props whose value a type's render-default always overrides. Returns the map
745
745
  * unchanged (same reference) when the type suppresses nothing. */
746
746
  declare function stripSuppressedProps(type: string, styleProps: Record<string, any>): Record<string, any>;
747
+ /**
748
+ * What a compiled rule is FOR — decides whether an initial value is a no-op.
749
+ *
750
+ * In a `Base` rule nothing is being overridden, so `width: auto` or `transform: none` changes
751
+ * nothing and is dropped (see NOOP_INITIAL_VALUES). In an `Override` rule — a breakpoint layer —
752
+ * the initial value is exactly how you UNDO a wider rule (`width: 520px` → `auto` on mobile), so
753
+ * dropping it would silently keep the desktop value.
754
+ */
755
+ declare enum DeclarationContext {
756
+ Base = "base",
757
+ Override = "override"
758
+ }
747
759
  /**
748
760
  * Compile a flat, camelCase style map into an array of `"prop: value"` CSS
749
- * declarations (kebab-cased, viewport-units rewritten, empties + no-op initials dropped,
750
- * optional `!important`). Callers wrap these in whatever selector they emit.
761
+ * declarations (kebab-cased, viewport-units rewritten, empties dropped, no-op initials dropped
762
+ * in a `Base` context only, optional `!important`). Callers wrap these in whatever selector
763
+ * they emit.
751
764
  *
752
765
  * @param props Flat camelCase style map.
753
766
  * @param importantProps Keys that must carry `!important` (e.g. `position`, to beat
754
767
  * Angular's scoped-CSS specificity boost in the builder). A prop forced
755
768
  * `!important` is never dropped as a no-op — the `!important` exists to win
756
769
  * the cascade, so its value must always be emitted.
770
+ * @param context `Override` for a rule that overrides a wider one (a breakpoint layer):
771
+ * initial values are kept, because there they reset rather than no-op.
757
772
  */
758
- declare function compileDeclarations(props: Record<string, any>, importantProps?: ReadonlySet<string>): string[];
773
+ declare function compileDeclarations(props: Record<string, any>, importantProps?: ReadonlySet<string>, context?: DeclarationContext): string[];
759
774
  /**
760
775
  * Per-type default `width` that the builder applies from each component's config
761
776
  * (NOT persisted in styleProps — see render-parity.md "saved node is not
@@ -779,6 +794,25 @@ declare const DEFAULT_WIDTH_BY_TYPE: Readonly<Record<string, string>>;
779
794
  */
780
795
  declare function renderDefaultDeclarations(type: string, styleProps: Record<string, any>, hasHoverState: boolean): string[];
781
796
 
797
+ /**
798
+ * One composed output property and the virtual traits it is built from.
799
+ *
800
+ * Consumers that emit a PARTIAL override (a breakpoint layer — see `responsive.ts`) need
801
+ * to know which outputs an override actually touches, and what to emit when a touched
802
+ * group composes to nothing (e.g. translateX reset to 0px while the base had 20px: the
803
+ * override must say `transform: none`, or the wider rule's transform silently wins).
804
+ */
805
+ interface VirtualTraitGroup {
806
+ /** The composed key `composeVirtualTraits` writes (camelCase, or `__markerStyles`). */
807
+ readonly output: string;
808
+ /** The virtual trait keys that feed it. */
809
+ readonly keys: readonly string[];
810
+ /** Value that cancels a wider rule's output, or `null` when there is no such value
811
+ * (`::marker` styles are a nested map, not a single cancellable property). */
812
+ readonly reset: string | null;
813
+ }
814
+ declare const VIRTUAL_TRAIT_GROUPS: readonly VirtualTraitGroup[];
815
+ /** Every virtual trait key — derived from the groups so there is one list to maintain. */
782
816
  declare const VIRTUAL_TRAIT_KEYS: Set<string>;
783
817
  /**
784
818
  * Strip virtual trait keys from `raw` and emit their composed CSS equivalents.
@@ -834,6 +868,149 @@ declare function nearestCommonAncestorId(root: readonly StyleTreeNode[], styledC
834
868
  */
835
869
  declare function buildTargetedStateSelector(scopeCssId: string, triggerCssId: string, styledCssId: string, base: string): string;
836
870
 
871
+ /** The five fixed breakpoints (plan decision D2). Desktop-first: each narrower one
872
+ * overrides the wider ones through `max-width`. */
873
+ declare enum Breakpoint {
874
+ Base = "base",
875
+ Laptop = "laptop",
876
+ Tablet = "tablet",
877
+ Mobile = "mobile",
878
+ Small = "small"
879
+ }
880
+ /** Every breakpoint that can hold overrides. Base styles live in `styleProps`. */
881
+ type OverrideBreakpoint = Exclude<Breakpoint, Breakpoint.Base>;
882
+ interface BreakpointDef {
883
+ readonly id: Breakpoint;
884
+ readonly label: string;
885
+ /** Inclusive upper bound in CSS px (`max-width`). `null` for Base, which has no query. */
886
+ readonly maxWidth: number | null;
887
+ /** Width the builder canvas simulates while this breakpoint is being edited. Always
888
+ * inside the breakpoint's own range (above the next one's `maxWidth`). */
889
+ readonly previewWidth: number;
890
+ }
891
+ /**
892
+ * Widest → narrowest. This order IS the cascade order and the `@media` emission order.
893
+ *
894
+ * ⚠️ Phones in portrait (360–430px) land in `Small`, NOT `Mobile` — `Mobile` is 480–767,
895
+ * a phone held landscape. The labels say so (as Webflow's do). The ids stay short because
896
+ * they are storage keys; the cascade still makes a `Mobile` override reach every phone.
897
+ */
898
+ declare const BREAKPOINTS: readonly BreakpointDef[];
899
+ /** The definition for `bp`, or `undefined` for an unknown id (e.g. hand-edited JSON). */
900
+ declare function breakpointDef(bp: Breakpoint | string): BreakpointDef | undefined;
901
+ /** Base → `bp`, inclusive — the layers whose values apply at `bp`. Unknown → `[Base]`. */
902
+ declare function cascadeChain(bp: Breakpoint | string): Breakpoint[];
903
+ /**
904
+ * The breakpoint a viewport (or canvas) of `width` CSS px falls in — the narrowest one whose
905
+ * `maxWidth` it fits under, else Base. Mirrors how the `max-width` media queries resolve, so the
906
+ * builder's editing scope is always the breakpoint the canvas is actually showing.
907
+ */
908
+ declare function breakpointForWidth(width: number): Breakpoint;
909
+ /** The next-wider breakpoint (what `bp` inherits from), or `null` for Base / unknown. */
910
+ declare function parentBreakpoint(bp: Breakpoint | string): Breakpoint | null;
911
+ /**
912
+ * What a breakpoint's width is measured against.
913
+ *
914
+ * `Media` — the browser viewport. The SSR engine: a visitor's window IS the page.
915
+ * `Container` — a named CSS size container. The builder: its canvas is a fixed-width frame inside a
916
+ * desktop browser (and `transform: scale`d for zoom), so a media query would read the EDITOR's width.
917
+ * A container query reads the frame's own layout width — which equals the simulated viewport and
918
+ * ignores the zoom transform — so the builder emits the same structure as the engine.
919
+ */
920
+ declare enum BreakpointQueryKind {
921
+ Media = "media",
922
+ Container = "container"
923
+ }
924
+ /**
925
+ * The at-rule prelude for `bp` — `@media (max-width: 767px)`, or with `Container`
926
+ * `@container iox-canvas (max-width: 767px)`. `null` for Base or an unknown id.
927
+ * `containerName` is required for `Container` (an unnamed container query would match
928
+ * whichever ancestor container is nearest, which is not guaranteed to be the canvas).
929
+ */
930
+ declare function breakpointQueryFor(bp: Breakpoint | string, kind?: BreakpointQueryKind, containerName?: string): string | null;
931
+ /** Wrap already-compiled rules for `bp`. Base (and blank css) passes through unwrapped. */
932
+ declare function wrapInBreakpointQuery(bp: Breakpoint | string, css: string, kind?: BreakpointQueryKind, containerName?: string): string;
933
+ /** `@media (max-width: 767px)` for `bp`; `null` for Base or an unknown id. */
934
+ declare function mediaQueryFor(bp: Breakpoint | string): string | null;
935
+ /** Wrap already-compiled rules for `bp` in its media query. Base (and blank css) passes through. */
936
+ declare function wrapInMediaQuery(bp: Breakpoint | string, css: string): string;
937
+ type StyleMap = Record<string, any>;
938
+ type StateStyleMap = Record<string, StyleMap>;
939
+ /** What one breakpoint overrides. Both maps are SPARSE — only keys that differ. */
940
+ interface ResponsiveLayer {
941
+ styleProps?: StyleMap;
942
+ stateStyles?: StateStyleMap;
943
+ }
944
+ type ResponsiveOverrides = Partial<Record<OverrideBreakpoint, ResponsiveLayer>>;
945
+ /** The full effective style map at `bp`: base, then each layer down the cascade. */
946
+ declare function resolveStyleProps(styleProps: StyleMap | null | undefined, responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string): StyleMap;
947
+ /** The effective per-state maps at `bp`. States with no values anywhere are omitted. */
948
+ declare function resolveStateStyles(stateStyles: StateStyleMap | null | undefined, responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string): StateStyleMap;
949
+ /**
950
+ * Every state that has a value anywhere — at base or at any breakpoint — in a stable order
951
+ * (base states first, then any that exist only at a breakpoint). A renderer iterates this, not
952
+ * `Object.keys(stateStyles)`, so a state defined ONLY at a breakpoint (a Mobile-only hover) still
953
+ * gets its selector scope resolved.
954
+ */
955
+ declare function stateNamesIn(stateStyles: StateStyleMap | null | undefined, responsive: ResponsiveOverrides | null | undefined): string[];
956
+ /** One level of the cascade that sets a value. */
957
+ interface ValueSource {
958
+ breakpoint: Breakpoint;
959
+ value: any;
960
+ }
961
+ /**
962
+ * Every level from Base down to `bp` that sets `prop` (optionally within `state`), in
963
+ * cascade order. The LAST entry is the effective value; an empty array means unset.
964
+ * Drives the style panel's source chain ("Base 34 → Tablet 28 → Mobile 22").
965
+ */
966
+ declare function resolveValueChain(prop: string, styleProps: StyleMap | null | undefined, stateStyles: StateStyleMap | null | undefined, responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string, state?: string): ValueSource[];
967
+ /** True when `bp` itself sets `prop` (the style panel's orange edge). Never true for Base. */
968
+ declare function isOverriddenAt(responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string, prop: string, state?: string): boolean;
969
+ /** Number of overridden values — at `bp`, or across every breakpoint when omitted. */
970
+ declare function countOverrides(responsive: ResponsiveOverrides | null | undefined, bp?: Breakpoint | string): number;
971
+ /** Returns a new overrides object with `prop` set at `bp` (optionally within `state`). */
972
+ declare function setOverride(responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string, prop: string, value: any, state?: string): ResponsiveOverrides;
973
+ /**
974
+ * Remove overrides at `bp` and PRUNE whatever becomes empty, so "reset" and "never
975
+ * overridden" are the same state on disk — no tombstones, no nulls.
976
+ *
977
+ * clearOverride(r, bp) — the whole breakpoint
978
+ * clearOverride(r, bp, undefined, st) — one state at that breakpoint
979
+ * clearOverride(r, bp, prop) — one base-state value
980
+ * clearOverride(r, bp, prop, st) — one value within a state
981
+ *
982
+ * Returns `undefined` when nothing is left, so a serialiser omits the key entirely.
983
+ */
984
+ declare function clearOverride(responsive: ResponsiveOverrides | null | undefined, bp: Breakpoint | string, prop?: string, state?: string): ResponsiveOverrides | undefined;
985
+ /**
986
+ * Everything one breakpoint must emit, already composed. Wrap in `mediaQuery` (engine)
987
+ * or apply directly (builder, flattened).
988
+ *
989
+ * ⚠️ Compile these maps with `compileDeclarations(map, …, DeclarationContext.Override)`. The
990
+ * default Base context drops CSS initial values as no-ops — but here `width: auto` or
991
+ * `transform: none` is how a breakpoint UNDOES the wider value, and dropping it silently keeps
992
+ * the desktop style.
993
+ */
994
+ interface ResponsiveRuleSet {
995
+ breakpoint: OverrideBreakpoint;
996
+ mediaQuery: string;
997
+ /** Sparse declarations for the node itself at this width (virtual traits composed). */
998
+ styleProps: StyleMap;
999
+ /** Sparse declarations per state at this width (virtual traits composed). */
1000
+ stateStyles: StateStyleMap;
1001
+ }
1002
+ /**
1003
+ * The per-breakpoint rule sets a node needs, widest → narrowest (the order they must be
1004
+ * emitted in, AFTER every base rule — equal specificity means source order decides).
1005
+ * Breakpoints with nothing to emit are omitted.
1006
+ *
1007
+ * Handles the cross-axis case: a breakpoint that changes a virtual group (say
1008
+ * `translateX`) also re-emits that group for every state the node has, because the wider
1009
+ * state rule was composed against the wider value and would otherwise snap back to it on
1010
+ * hover.
1011
+ */
1012
+ declare function planResponsiveRules(styleProps: StyleMap | null | undefined, stateStyles: StateStyleMap | null | undefined, responsive: ResponsiveOverrides | null | undefined): ResponsiveRuleSet[];
1013
+
837
1014
  /**
838
1015
  * Shared data-source resolving pattern — the SINGLE source of truth for how an IoxDataSource
839
1016
  * becomes a backend fetch, consumed by BOTH the page builder (iox-cms-client bindings panel) and
@@ -1751,5 +1928,5 @@ declare class GalleryLoop {
1751
1928
  private emit;
1752
1929
  }
1753
1930
 
1754
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CONTEXT_ACTION_TYPES, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, ContextStore, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, activeActions, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isActionEnabled, isContextAction, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab, variableAliases, variableItemsFrom, withContextSlots };
1755
- export type { BuildRelatedFilterOptions, ContextActionEffect, ContextActionLike, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, DataSourceDomain, DataSourceEndpoints, DataSourceMode, DataSourcePlan, DataSourceQueryFilter, DataSourceRequest, DataSourceRequestSpec, DataSourceRouteFilter, DataSourceSpec, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, IBuilderEventEmitter, IoxContextSlot, IoxPipe, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, RelativeInputs, RelativeSourceKind, RelativeSourceSpec, ResolveSiblingsOptions, ResolvedPageTransition, RouteContext, SetContextParams, SiblingsResult, StyleTreeNode, ToggleableAction, TransitionFeel, TransitionPhase, TransitionTimelineInput };
1931
+ export { AOSService, AnalyticsService, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CONTEXT_ACTION_TYPES, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, ContextStore, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, DeclarationContext, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, activeActions, applyBindingPipes, applyFeel, breakpointDef, breakpointForWidth, breakpointQueryFor, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, cascadeChain, clearOverride, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, countOverrides, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isActionEnabled, isContextAction, isOverriddenAt, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, mediaQueryFor, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, parentBreakpoint, parseUrlList, planDataSource, planResponsiveRules, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, resolveStateStyles, resolveStyleProps, resolveValueChain, rewriteViewportUnits, safeSetInput, setOverride, stateNamesIn, stripSuppressedProps, styleKeyToKebab, variableAliases, variableItemsFrom, withContextSlots, wrapInBreakpointQuery, wrapInMediaQuery };
1932
+ export type { BreakpointDef, BuildRelatedFilterOptions, ContextActionEffect, ContextActionLike, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, DataSourceDomain, DataSourceEndpoints, DataSourceMode, DataSourcePlan, DataSourceQueryFilter, DataSourceRequest, DataSourceRequestSpec, DataSourceRouteFilter, DataSourceSpec, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, IBuilderEventEmitter, IoxContextSlot, IoxPipe, OverrideBreakpoint, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, RelativeInputs, RelativeSourceKind, RelativeSourceSpec, ResolveSiblingsOptions, ResolvedPageTransition, ResponsiveLayer, ResponsiveOverrides, ResponsiveRuleSet, RouteContext, SetContextParams, SiblingsResult, StateStyleMap, StyleMap, StyleTreeNode, ToggleableAction, TransitionFeel, TransitionPhase, TransitionTimelineInput, ValueSource, VirtualTraitGroup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "4.22.0",
3
+ "version": "4.24.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -10,16 +10,15 @@
10
10
  "tslib": "^2.3.0"
11
11
  },
12
12
  "module": "fesm2022/vectoriox-iox-ui.mjs",
13
- "typings": "types/vectoriox-iox-ui.d.ts",
13
+ "typings": "index.d.ts",
14
14
  "exports": {
15
15
  "./package.json": {
16
16
  "default": "./package.json"
17
17
  },
18
18
  ".": {
19
- "types": "./types/vectoriox-iox-ui.d.ts",
19
+ "types": "./index.d.ts",
20
20
  "default": "./fesm2022/vectoriox-iox-ui.mjs"
21
21
  }
22
22
  },
23
- "sideEffects": false,
24
- "type": "module"
23
+ "sideEffects": false
25
24
  }