@vectoriox/iox-ui 4.17.1 → 4.17.3

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, HostListener, Output, Input, Directive, NgModule, Injectable, ViewChild, Component, Host, Optional, inject, NgZone, Inject, InjectionToken, PLATFORM_ID, ChangeDetectionStrategy, ViewContainerRef } from '@angular/core';
2
+ import { EventEmitter, HostListener, Output, Input, Directive, NgModule, Injectable, ViewChild, Component, Host, Optional, inject, NgZone, Inject, InjectionToken, PLATFORM_ID, ChangeDetectionStrategy, ViewContainerRef, reflectComponentType } from '@angular/core';
3
3
  import * as i2 from '@angular/animations';
4
4
  import { style, animate } from '@angular/animations';
5
5
  import { Subject, fromEvent, of } from 'rxjs';
@@ -871,13 +871,26 @@ class BuilderImageComponent {
871
871
  this.alt = 'Image';
872
872
  this.nodeId = '';
873
873
  }
874
+ /**
875
+ * The `src` attribute value, or `null` to OMIT the attribute entirely when there is no image.
876
+ *
877
+ * `src=""` is not "no image": the browser resolves the empty string against the document URL and
878
+ * re-requests the PAGE itself as an image — a broken-image icon plus a wasted round trip. Angular
879
+ * removes an attribute bound to `null`, which is the only way to render a genuinely src-less img.
880
+ *
881
+ * An empty src is a normal state, not a mistake: a context slot starts empty on purpose and is
882
+ * filled when the visitor interacts (see element-context-state-plan.md).
883
+ */
884
+ get srcAttr() {
885
+ return this.src || null;
886
+ }
874
887
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
875
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderImageComponent, isStandalone: false, selector: "img[iox-img]", inputs: { src: "src", alt: "alt", nodeId: "nodeId" }, host: { properties: { "attr.src": "src", "attr.alt": "alt", "class": "'iox-node-' + nodeId" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;max-width:100%}\n"] }); }
888
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderImageComponent, isStandalone: false, selector: "img[iox-img]", inputs: { src: "src", alt: "alt", nodeId: "nodeId" }, host: { properties: { "attr.src": "srcAttr", "attr.alt": "alt", "class": "'iox-node-' + nodeId" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;max-width:100%}\n"] }); }
876
889
  }
877
890
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderImageComponent, decorators: [{
878
891
  type: Component,
879
892
  args: [{ selector: 'img[iox-img]', template: '', host: {
880
- '[attr.src]': 'src',
893
+ '[attr.src]': 'srcAttr',
881
894
  '[attr.alt]': 'alt',
882
895
  '[class]': "'iox-node-' + nodeId",
883
896
  }, standalone: false, styles: [":host{display:block;max-width:100%}\n"] }]
@@ -3200,6 +3213,53 @@ const PIPE_DESCRIPTORS = [
3200
3213
  { name: 'number', label: 'Number', args: [{ key: 'decimals', label: 'Decimals', control: 'number', default: null }] },
3201
3214
  ];
3202
3215
 
3216
+ /**
3217
+ * Declared-input reflection + safe input application, shared by every dynamic renderer
3218
+ * (builder `RenderDirective`, builder bindings panel, SSR `ClientTreeRendererService`).
3219
+ *
3220
+ * WHY THIS EXISTS: `ComponentRef.setInput(name, value)` for an input the component does NOT
3221
+ * declare does **not throw** — in dev mode it calls `reportUnknownPropertyError`, which
3222
+ * `console.error`s `NG0303: Can't set value of the '<name>' input ...` and returns without
3223
+ * setting anything. A `try/catch` around `setInput` is therefore dead code (nothing is thrown)
3224
+ * AND the value is silently dropped. On every (re-)render — drag, duplicate, save-triggered
3225
+ * re-render, repeater/slider clones — that spams the console and skips the write.
3226
+ *
3227
+ * The fix is to reflect the component's declared inputs ONCE (cached) and only `setInput` names
3228
+ * that exist; anything else is assigned directly on the instance (harmless for consumers that
3229
+ * read the raw property, e.g. a `sourcePath`/`source` binding pushed to a SliderContainer).
3230
+ */
3231
+ /** Per-component-class cache of declared public input names (templateName / alias). */
3232
+ const inputNameCache = new WeakMap();
3233
+ /**
3234
+ * The public input names (`@Input()` / `input()` / `model()`, honouring aliases) a component
3235
+ * class declares. Cached per class — `reflectComponentType` is not free. Returns an empty set
3236
+ * for a class Angular can't reflect (e.g. a non-component).
3237
+ */
3238
+ function declaredInputNames(type) {
3239
+ let names = inputNameCache.get(type);
3240
+ if (!names) {
3241
+ const mirror = reflectComponentType(type);
3242
+ names = new Set((mirror?.inputs ?? []).map(i => i.templateName));
3243
+ inputNameCache.set(type, names);
3244
+ }
3245
+ return names;
3246
+ }
3247
+ /**
3248
+ * Set `name` on `ref` as an Angular input **only** when the component declares it (so change
3249
+ * detection + signal inputs work); otherwise assign directly on the instance and mark it for
3250
+ * check. Never produces an NG0303 error and never silently drops the value. Returns `true` if
3251
+ * it was applied as a real input, `false` if it fell back to direct assignment.
3252
+ */
3253
+ function safeSetInput(ref, name, value) {
3254
+ if (declaredInputNames(ref.componentType).has(name)) {
3255
+ ref.setInput(name, value);
3256
+ return true;
3257
+ }
3258
+ ref.instance[name] = value;
3259
+ ref.changeDetectorRef.markForCheck();
3260
+ return false;
3261
+ }
3262
+
3203
3263
  /**
3204
3264
  * Cinematic page-transition presets — the SINGLE SOURCE OF TRUTH shared by the page builder
3205
3265
  * (preview) and the SSR client engine (production). Pure, transport-agnostic: this module only
@@ -3634,5 +3694,5 @@ function effectiveTransitionId(anim) {
3634
3694
  * Generated bundle index. Do not edit.
3635
3695
  */
3636
3696
 
3637
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, 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, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, stripSuppressedProps, styleKeyToKebab };
3697
+ export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, 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, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab };
3638
3698
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map