@vectoriox/iox-builder 2.3.3 → 2.3.4

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.
@@ -2395,6 +2395,39 @@ function arraySchemaFields(properties) {
2395
2395
  }
2396
2396
  return out;
2397
2397
  }
2398
+ /**
2399
+ * Describe the ITEM shape of an array PROPERTY, straight from the schema — the authoritative source
2400
+ * (a resolved sample may be missing, or ambiguous). Given a resource's schema `properties` and the
2401
+ * dot-path to an array field (e.g. `gallery` or `info.items`):
2402
+ * - **object item** → its primitive leaf fields (flattened): `[{label:'url',value:'url'}, …]`.
2403
+ * - **primitive item** (`string[]`/`number[]`) → `isPrimitive:true` (caller offers "(the item value)").
2404
+ * - **can't tell** (many-relation whose items are related docs, or path not found) → both empty, so
2405
+ * the caller falls back to a resolved sample.
2406
+ * JSON-schema arrays store the item schema under `.items`; embedded objects under `.properties`.
2407
+ */
2408
+ function arrayItemSchemaFields(properties, arrayPath) {
2409
+ const parts = (arrayPath ?? '').split('.').filter(Boolean);
2410
+ let field = undefined;
2411
+ let cursor = properties ?? {};
2412
+ for (const part of parts) {
2413
+ field = cursor?.[part];
2414
+ if (!field)
2415
+ return { fields: [], isPrimitive: false };
2416
+ cursor = field.properties ?? field.items?.properties ?? {};
2417
+ }
2418
+ if (!field)
2419
+ return { fields: [], isPrimitive: false };
2420
+ const itemProps = field.items?.properties ?? (field.type === 'embedded' ? field.properties : undefined);
2421
+ if (itemProps && Object.keys(itemProps).length) {
2422
+ return { fields: flattenSchemaFields(itemProps), isPrimitive: false };
2423
+ }
2424
+ // Many-relation: items are related documents — needs the related schema, so let the caller sample.
2425
+ const relType = (field.rel?.type ?? '').toString().toLowerCase();
2426
+ if (field.type === 'rel' || relType.includes('many'))
2427
+ return { fields: [], isPrimitive: false };
2428
+ // Otherwise a primitive-item array (string[]/number[]/…): the item is bound as its own value.
2429
+ return { fields: [], isPrimitive: true };
2430
+ }
2398
2431
 
2399
2432
  /**
2400
2433
  * StyleRegistryService — manages a single <style> tag for the builder canvas.
@@ -8143,5 +8176,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
8143
8176
  * Generated bundle index. Do not edit.
8144
8177
  */
8145
8178
 
8146
- export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, 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_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, 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, ViewportService, ZOOM_OPTIONS, arraySchemaFields, buildFullStyleTraits, buildPresetStyleTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
8179
+ export { ACTION_TYPE_OPTIONS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, 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_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, 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, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, buildFullStyleTraits, buildPresetStyleTraits, defaultPageSettings, flattenSchemaFields, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
8147
8180
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map