@vectoriox/iox-ui 4.35.0 → 4.36.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.
@@ -971,6 +971,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
971
971
  type: Input
972
972
  }] } });
973
973
 
974
+ /**
975
+ * Phosphor's CSS needs TWO classes — a weight and a name (`.ph-thin.ph-house:before`). A class
976
+ * string carrying only the name matches nothing at all: no `font-family`, no glyph, so the element
977
+ * renders as an invisible, zero-glyph box.
978
+ *
979
+ * The icon picker used to emit exactly that (`ph-house`), so every icon chosen through it was blank
980
+ * on the canvas, in the picker grid and on the live site. Fixing the picker alone would leave every
981
+ * icon already saved broken, so the repair happens at RENDER time, here, and is shared by the
982
+ * builder's Icon component and the SSR engine's renderer.
983
+ *
984
+ * Everything that is not a weightless Phosphor class passes through untouched — Iconoir
985
+ * (`iconoir-home`), custom icon-set fonts, Font Awesome, and Phosphor strings that already carry a
986
+ * weight.
987
+ *
988
+ * See iox-ai-guidance `architecture/cms/custom-icon-fonts.md`.
989
+ */
990
+ /** The weight classes Phosphor ships. `ph` is the regular weight. */
991
+ const PHOSPHOR_WEIGHTS = new Set(['ph', 'ph-thin', 'ph-light', 'ph-regular', 'ph-bold', 'ph-fill', 'ph-duotone']);
992
+ /** The weight assumed when a Phosphor class has none — the weight this platform uses everywhere. */
993
+ const DEFAULT_PHOSPHOR_WEIGHT = 'ph-thin';
994
+ function normalizeIconClass(iconClass) {
995
+ const raw = (iconClass ?? '').trim();
996
+ if (!raw)
997
+ return '';
998
+ const tokens = raw.split(/\s+/);
999
+ const hasWeight = tokens.some(token => PHOSPHOR_WEIGHTS.has(token));
1000
+ if (hasWeight)
1001
+ return tokens.join(' ');
1002
+ // `ph-` prefixed but weightless — the broken shape. A token that is only `ph-` is not a name.
1003
+ const hasPhosphorName = tokens.some(token => token.startsWith('ph-') && token.length > 3);
1004
+ if (!hasPhosphorName)
1005
+ return tokens.join(' ');
1006
+ return [DEFAULT_PHOSPHOR_WEIGHT, ...tokens].join(' ');
1007
+ }
1008
+
974
1009
  /** Directive-host icon: the `<i>` IS the host — no wrapper. All styles on `.iox-node`. */
975
1010
  class BuilderIconComponent {
976
1011
  constructor() {
@@ -978,12 +1013,20 @@ class BuilderIconComponent {
978
1013
  this.iconClass = 'ph-thin ph-star';
979
1014
  this.nodeId = '';
980
1015
  }
1016
+ /**
1017
+ * Repaired at render time: a Phosphor class saved without its weight (`ph-house`) matches no CSS
1018
+ * rule and renders as an invisible box. The picker used to emit exactly that, so this keeps
1019
+ * every already-saved icon working. Shared with the SSR engine — see `normalizeIconClass`.
1020
+ */
1021
+ get normalizedIconClass() {
1022
+ return normalizeIconClass(this.iconClass);
1023
+ }
981
1024
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
982
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderIconComponent, isStandalone: false, selector: "i[iox-icon]", inputs: { iconClass: "iconClass", nodeId: "nodeId" }, host: { properties: { "class": "iconClass + ' iox-node-' + nodeId" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}\n"] }); }
1025
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderIconComponent, isStandalone: false, selector: "i[iox-icon]", inputs: { iconClass: "iconClass", nodeId: "nodeId" }, host: { properties: { "class": "normalizedIconClass + ' iox-node-' + nodeId" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}\n"] }); }
983
1026
  }
984
1027
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderIconComponent, decorators: [{
985
1028
  type: Component,
986
- args: [{ selector: 'i[iox-icon]', template: '', host: { '[class]': "iconClass + ' iox-node-' + nodeId" }, standalone: false, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}\n"] }]
1029
+ args: [{ selector: 'i[iox-icon]', template: '', host: { '[class]': "normalizedIconClass + ' iox-node-' + nodeId" }, standalone: false, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}\n"] }]
987
1030
  }], propDecorators: { iconClass: [{
988
1031
  type: Input
989
1032
  }], nodeId: [{
@@ -6735,5 +6778,5 @@ function effectiveTransitionId(anim) {
6735
6778
  * Generated bundle index. Do not edit.
6736
6779
  */
6737
6780
 
6738
- 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, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_RESPONSIVE_TRAITS, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, activeActions, applyBindingPipes, applyFeel, breakpointDef, breakpointForWidth, breakpointQueryFor, buildDataSourceFilter, buildRelatedFilter, buildSwiperBreakpoints, buildTargetedStateSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, countOverrides, dataSourcePlanToRequest, declaredInputNames, defaultMessageResolver, deriveSeoFromContent, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isActionEnabled, isContextAction, isInputOverriddenAt, isOverriddenAt, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, mediaQueryFor, mergeSwiperBreakpoints, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, normalizeGalleryImage, parentBreakpoint, parseUrlList, planDataSource, planResponsiveRules, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveBoundValue, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSeo, resolveSiblings, resolveSingleItemId, resolveStateStyles, resolveStyleProps, resolveValueChain, rewriteViewportUnits, safeSetInput, setInputOverride, setOverride, stateNamesIn, stripSuppressedProps, styleKeyToKebab, variableAliases, variableItemsFrom, withContextSlots, wrapInBreakpointQuery, wrapInMediaQuery };
6781
+ 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_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DeclarationContext, ENVIRONMENT, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_RESPONSIVE_TRAITS, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, activeActions, applyBindingPipes, applyFeel, breakpointDef, breakpointForWidth, breakpointQueryFor, buildDataSourceFilter, buildRelatedFilter, buildSwiperBreakpoints, buildTargetedStateSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, countOverrides, dataSourcePlanToRequest, declaredInputNames, defaultMessageResolver, deriveSeoFromContent, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isActionEnabled, isContextAction, isInputOverriddenAt, isOverriddenAt, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, mediaQueryFor, mergeSwiperBreakpoints, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, normalizeGalleryImage, normalizeIconClass, parentBreakpoint, parseUrlList, planDataSource, planResponsiveRules, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveBoundValue, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSeo, resolveSiblings, resolveSingleItemId, resolveStateStyles, resolveStyleProps, resolveValueChain, rewriteViewportUnits, safeSetInput, setInputOverride, setOverride, stateNamesIn, stripSuppressedProps, styleKeyToKebab, variableAliases, variableItemsFrom, withContextSlots, wrapInBreakpointQuery, wrapInMediaQuery };
6739
6782
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map