@vectoriox/iox-builder 4.1.2 → 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.
@@ -8534,6 +8534,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
8534
8534
  /** Optional font manager. Provide from the host app to populate the fontFamily dropdown. */
8535
8535
  const IOX_FONT_MANAGER = new InjectionToken('IOX_FONT_MANAGER');
8536
8536
 
8537
+ /**
8538
+ * STRUCTURE OPS (A4) — the one-click layout changes people actually make at a narrow width, as pure
8539
+ * "what to write" functions. Each returns a flat style map the caller stores in the node's
8540
+ * `responsive[bp]` layer (or in the base styles at Base) through the shared `setOverride`.
8541
+ *
8542
+ * All of it is ordinary CSS the SSR engine already renders — there is no second tree and no
8543
+ * per-width HTML. See responsive-breakpoints-plan.md (D5).
8544
+ */
8545
+ /** CSS lengths that are a FIXED pixel size — the ones that stop a layout fitting a phone. */
8546
+ const PX_LENGTH = /^-?\d+(\.\d+)?px$/i;
8547
+ /**
8548
+ * Hide / show at a width. Hiding is `display: none` INSIDE that breakpoint's rules — the node stays
8549
+ * in the DOM and in the SSR output (one HTML document serves every width), so hidden content still
8550
+ * ships bytes and is still indexed. Showing again clears the override rather than guessing a value.
8551
+ *
8552
+ * @returns the props to write, or `null` meaning "clear the display override at this breakpoint".
8553
+ */
8554
+ function visibilityProps(hidden) {
8555
+ return hidden ? { display: 'none' } : null;
8556
+ }
8557
+ /** True when this node is hidden by the resolved styles at some width. */
8558
+ function isHiddenAt(resolvedStyleProps) {
8559
+ return String(resolvedStyleProps?.['display'] ?? '') === 'none';
8560
+ }
8561
+ /**
8562
+ * Stack a container's children in one column — the most common mobile edit, and four separate
8563
+ * controls today (display, direction, wrap, columns). A grid becomes a single-column grid; anything
8564
+ * else becomes a column flex box.
8565
+ */
8566
+ function stackChildrenProps(resolvedStyleProps) {
8567
+ const display = String(resolvedStyleProps?.['display'] ?? '');
8568
+ if (display === 'grid' || display === 'inline-grid') {
8569
+ return { gridTemplateColumns: 'repeat(1, minmax(0, 1fr))' };
8570
+ }
8571
+ return { display: 'flex', flexDirection: 'column', flexWrap: 'nowrap' };
8572
+ }
8573
+ /**
8574
+ * Collapse a grid to `count` columns (a flex row is stacked instead — it has no column track).
8575
+ * `count` is clamped to at least 1.
8576
+ */
8577
+ function collapseColumnsProps(resolvedStyleProps, count) {
8578
+ const columns = Math.max(1, Math.floor(count));
8579
+ const display = String(resolvedStyleProps?.['display'] ?? '');
8580
+ if (display === 'grid' || display === 'inline-grid') {
8581
+ return { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` };
8582
+ }
8583
+ return columns === 1 ? stackChildrenProps(resolvedStyleProps) : { flexWrap: 'wrap' };
8584
+ }
8585
+ /** How many equal columns a `repeat(N, …)` track list describes, or null when it isn't one. */
8586
+ function columnCountOf(resolvedStyleProps) {
8587
+ const match = /^repeat\(\s*(\d+)\s*,/.exec(String(resolvedStyleProps?.['gridTemplateColumns'] ?? ''));
8588
+ return match ? Number(match[1]) : null;
8589
+ }
8590
+ /**
8591
+ * Make fixed pixel sizes fluid: `width: 520px` → `width: 100%` with the original kept as
8592
+ * `max-width`, so the element still never exceeds its designed size on a wide screen. `minWidth` in
8593
+ * px is dropped to 0 — it is what actually forces horizontal scrolling on a phone.
8594
+ *
8595
+ * @returns the props to write; EMPTY when there is nothing fixed to fluidise.
8596
+ */
8597
+ function fluidiseProps(resolvedStyleProps) {
8598
+ const out = {};
8599
+ const width = String(resolvedStyleProps?.['width'] ?? '');
8600
+ const minWidth = String(resolvedStyleProps?.['minWidth'] ?? '');
8601
+ if (PX_LENGTH.test(width)) {
8602
+ out['width'] = '100%';
8603
+ const maxWidth = String(resolvedStyleProps?.['maxWidth'] ?? '');
8604
+ if (!maxWidth || maxWidth === 'none')
8605
+ out['maxWidth'] = width;
8606
+ }
8607
+ if (PX_LENGTH.test(minWidth) && parseFloat(minWidth) > 0)
8608
+ out['minWidth'] = '0px';
8609
+ return out;
8610
+ }
8611
+ /** True when `fluidiseProps` would change anything — drives the button's disabled state. */
8612
+ function canFluidise(resolvedStyleProps) {
8613
+ return Object.keys(fluidiseProps(resolvedStyleProps)).length > 0;
8614
+ }
8615
+ /**
8616
+ * Reorder children AT ONE WIDTH using CSS `order`, leaving the tree — and so the DOM and
8617
+ * screen-reader order — untouched. Returns one value per child BY CHILD INDEX: the `order` it must
8618
+ * take, or `null` for "no override needed".
8619
+ *
8620
+ * Either every child gets an explicit `order` or none does: CSS defaults `order` to 0, so a partial
8621
+ * set would mix overridden children with unordered ones and read as an arbitrary interleave.
8622
+ *
8623
+ * @param count How many children there are.
8624
+ * @param from Index of the child being moved.
8625
+ * @param to Index it should occupy.
8626
+ */
8627
+ function reorderProps(count, from, to) {
8628
+ const none = Array.from({ length: Math.max(0, count) }, () => null);
8629
+ if (from < 0 || from >= count || to < 0 || to >= count || from === to)
8630
+ return none;
8631
+ // Visual order after the move, as a list of CHILD indices.
8632
+ const sequence = Array.from({ length: count }, (_, i) => i);
8633
+ sequence.splice(to, 0, ...sequence.splice(from, 1));
8634
+ const orderByChild = none.slice();
8635
+ sequence.forEach((childIndex, position) => { orderByChild[childIndex] = position; });
8636
+ return orderByChild;
8637
+ }
8638
+
8537
8639
  class BuilderButtonComponentConfig extends ComponentConfig {
8538
8640
  constructor() {
8539
8641
  super('Button', 'app-builder-button', 'ph-thin ph-cursor-click', 'Basic');
@@ -9087,5 +9189,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
9087
9189
  * Generated bundle index. Do not edit.
9088
9190
  */
9089
9191
 
9090
- 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$1 as 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 };
9192
+ 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$1 as 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 };
9091
9193
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map