@vectoriox/iox-builder 1.5.10 → 1.6.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.
|
@@ -271,6 +271,24 @@ class OverlayService {
|
|
|
271
271
|
}
|
|
272
272
|
return undefined;
|
|
273
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* Walk up the DOM from a node's registered host element to the nearest ANCESTOR
|
|
276
|
+
* element that is itself a registered node. Used to resolve the immediate parent
|
|
277
|
+
* for relational style states (e.g. parent-hover). Returns undefined for root nodes.
|
|
278
|
+
*/
|
|
279
|
+
getParentEntry(node) {
|
|
280
|
+
const ref = this.nodeMap.get(node);
|
|
281
|
+
if (!ref)
|
|
282
|
+
return undefined;
|
|
283
|
+
let el = ref.element.parentElement;
|
|
284
|
+
while (el) {
|
|
285
|
+
const match = this.findNodeByElement(el);
|
|
286
|
+
if (match)
|
|
287
|
+
return match;
|
|
288
|
+
el = el.parentElement;
|
|
289
|
+
}
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
274
292
|
setHover(element, componentName, mode) {
|
|
275
293
|
if (this.selectSubject.getValue()?.element === element)
|
|
276
294
|
return;
|
|
@@ -1998,7 +2016,17 @@ const EASING_OPTIONS = ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out'];
|
|
|
1998
2016
|
const INTERACTION_STATES = ['hover', 'active', 'focus'];
|
|
1999
2017
|
/** Structural pseudo-classes — compiled to .iox-outer-{id}:state */
|
|
2000
2018
|
const STRUCTURAL_STATES = ['first-child', 'last-child', 'nth-child(odd)', 'nth-child(even)'];
|
|
2001
|
-
|
|
2019
|
+
/**
|
|
2020
|
+
* Relational pseudo-classes — the styled element is a descendant, the pseudo-class
|
|
2021
|
+
* lives on an ANCESTOR. Compiled to `.iox-node-{parentId}:{base} .iox-node-{id} { … }`,
|
|
2022
|
+
* so they require the ancestor's css id (`relativeToId`) at compile time.
|
|
2023
|
+
* `RELATIONAL_STATE_BASE` maps each relational state to the ancestor pseudo-class.
|
|
2024
|
+
*/
|
|
2025
|
+
const RELATIONAL_STATES = ['parent-hover'];
|
|
2026
|
+
const RELATIONAL_STATE_BASE = {
|
|
2027
|
+
'parent-hover': 'hover',
|
|
2028
|
+
};
|
|
2029
|
+
const SUPPORTED_STATES = [...INTERACTION_STATES, ...STRUCTURAL_STATES, ...RELATIONAL_STATES];
|
|
2002
2030
|
/**
|
|
2003
2031
|
* Build a full StyleTraitGroup[] schema populated with values from a flat
|
|
2004
2032
|
* styleProps map. Used when editing a preset in the Style panel — the panel
|
|
@@ -2468,19 +2496,38 @@ class StyleRegistryService {
|
|
|
2468
2496
|
*
|
|
2469
2497
|
* @param nodeId The node's CSS id (used in `.iox-node-{nodeId}`)
|
|
2470
2498
|
* @param styles Flat CSS property map (camelCase keys)
|
|
2471
|
-
* @param state Optional pseudo-class state ('hover' | 'active' | 'focus').
|
|
2499
|
+
* @param state Optional pseudo-class state ('hover' | 'active' | 'focus' | …).
|
|
2472
2500
|
* When provided, compiles to `.iox-node-{id}:{state} { … }`.
|
|
2473
2501
|
* State rules are NOT partitioned into inner/outer.
|
|
2502
|
+
* @param relativeToId Ancestor css id, required for RELATIONAL states
|
|
2503
|
+
* (e.g. 'parent-hover'). Compiles to
|
|
2504
|
+
* `.iox-node-{relativeToId}:{base} .iox-node-{nodeId} { … }`.
|
|
2474
2505
|
*/
|
|
2475
|
-
upsert(nodeId, styles, state) {
|
|
2506
|
+
upsert(nodeId, styles, state, relativeToId) {
|
|
2476
2507
|
if (!nodeId)
|
|
2477
2508
|
return;
|
|
2478
2509
|
if (state) {
|
|
2510
|
+
const key = `${nodeId}:${state}`;
|
|
2511
|
+
// Relational states (parent-hover): the pseudo-class lives on an ANCESTOR
|
|
2512
|
+
// and cascades to this element. Requires the ancestor's css id.
|
|
2513
|
+
if (RELATIONAL_STATES.includes(state)) {
|
|
2514
|
+
const base = RELATIONAL_STATE_BASE[state];
|
|
2515
|
+
const css = (relativeToId && base)
|
|
2516
|
+
? this.compile(`iox-node-${relativeToId}:${base} .iox-node-${nodeId}`, styles)
|
|
2517
|
+
: '';
|
|
2518
|
+
if (css) {
|
|
2519
|
+
this.rules.set(key, css);
|
|
2520
|
+
}
|
|
2521
|
+
else {
|
|
2522
|
+
this.rules.delete(key);
|
|
2523
|
+
}
|
|
2524
|
+
this.flush();
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2479
2527
|
// Structural pseudo-classes (first-child, last-child, nth-child) target the
|
|
2480
2528
|
// outer wrapper element so they participate correctly in grid/flex layout.
|
|
2481
2529
|
const prefix = STRUCTURAL_STATES.includes(state) ? 'iox-outer' : 'iox-node';
|
|
2482
2530
|
const css = this.compile(`${prefix}-${nodeId}:${state}`, styles);
|
|
2483
|
-
const key = `${nodeId}:${state}`;
|
|
2484
2531
|
if (css) {
|
|
2485
2532
|
this.rules.set(key, css);
|
|
2486
2533
|
}
|
|
@@ -7452,5 +7499,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
|
|
|
7452
7499
|
* Generated bundle index. Do not edit.
|
|
7453
7500
|
*/
|
|
7454
7501
|
|
|
7455
|
-
export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DataSourceType, DeviceMode, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, IOX_SHOP_SERVICE, InteractionEngineService, InteractionPresetRegistryService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, 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, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VIRTUAL_TRAIT_KEYS, ViewportService, ZOOM_OPTIONS, buildFullStyleTraits, buildPresetStyleTraits, composeVirtualTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
|
|
7502
|
+
export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DataSourceType, DeviceMode, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EffectsGroupStyleConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, IOX_SHOP_SERVICE, InteractionEngineService, InteractionPresetRegistryService, InteractionsPanelComponent, 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, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VIRTUAL_TRAIT_KEYS, ViewportService, ZOOM_OPTIONS, buildFullStyleTraits, buildPresetStyleTraits, composeVirtualTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
|
|
7456
7503
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|