@vectoriox/iox-builder 11.2.0 → 11.3.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.
@@ -31,6 +31,7 @@ import Moveable from 'moveable';
31
31
  import Selecto from 'selecto';
32
32
  import * as i18 from 'primeng/api';
33
33
  import { planVideo, VideoSource, VIDEO_PROVIDER_LABEL, VideoTrait, VideoMode } from '@vectoriox/iox-ui/media-core';
34
+ import { entranceInteraction, entranceAction, sectionEntrances, EntrancePart } from '@vectoriox/iox-ui/generation-core';
34
35
  import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
35
36
 
36
37
  /**
@@ -13186,6 +13187,127 @@ function buildFlavorSpecimen(name, createConfig, copy) {
13186
13187
  root.label = 'Look specimen';
13187
13188
  return markSpecimen(withChildren(root, [withChildren(dots, dotNodes), primary, card]));
13188
13189
  }
13190
+ // ── The business specimen (AI plan rev 3.1 §3o, H4-1) ────────────────────────────────────────────────────────
13191
+ /** Which state of the specimen: the page, or "one card, opened" — the second state Preview changes page into. */
13192
+ var BusinessSpecimenView;
13193
+ (function (BusinessSpecimenView) {
13194
+ BusinessSpecimenView["Home"] = "home";
13195
+ BusinessSpecimenView["Item"] = "item";
13196
+ })(BusinessSpecimenView || (BusinessSpecimenView = {}));
13197
+ /** The families the specimen's blocks stand for — the contract's `animationFamilies` keys. */
13198
+ var SpecimenFamily;
13199
+ (function (SpecimenFamily) {
13200
+ SpecimenFamily["Hero"] = "hero";
13201
+ SpecimenFamily["Collection"] = "collection";
13202
+ SpecimenFamily["Feature"] = "feature";
13203
+ SpecimenFamily["Contact"] = "contact";
13204
+ SpecimenFamily["Detail"] = "detail";
13205
+ })(SpecimenFamily || (SpecimenFamily = {}));
13206
+ const CARD_COUNT = 3;
13207
+ function stamper(rtl) {
13208
+ return (node, spec, index = 0) => {
13209
+ if (!node?.id || !spec)
13210
+ return;
13211
+ node.interactions = [...(node.interactions ?? []), entranceInteraction(node.id, entranceAction(spec, { index, rtl }))];
13212
+ };
13213
+ }
13214
+ /**
13215
+ * A block of the specimen and its entrances: with `content` the block's children enter together, once; otherwise
13216
+ * each named part enters on its own (items one after another).
13217
+ */
13218
+ function block(createConfig, family, opts, children, parts, styles = {}) {
13219
+ const node = withChildren(styled(box(createConfig), { display: 'grid', gap: '16px', width: '100%', ...styles }), children);
13220
+ if (!node)
13221
+ return null;
13222
+ const plan = sectionEntrances(opts.animate, family);
13223
+ const stamp = stamper(!!opts.rtl);
13224
+ if (plan.content) {
13225
+ node.children.forEach(child => stamp(child, plan.content));
13226
+ return node;
13227
+ }
13228
+ for (const [part, nodes] of Object.entries(parts)) {
13229
+ nodes.forEach((n, i) => stamp(n, plan.parts[part], i));
13230
+ }
13231
+ return node;
13232
+ }
13233
+ function heading(styleId, content, level, createConfig) {
13234
+ const node = wearing(createConfig('Heading'), styleId);
13235
+ if (!node)
13236
+ return null;
13237
+ setTrait(node, 'content', content);
13238
+ setTrait(node, 'level', level);
13239
+ return styled(node, { margin: '0' });
13240
+ }
13241
+ /** A picture: the owner's photo, or the design system's empty box (a marked Image with no source). */
13242
+ function picture(createConfig, aspectRatio, src = '') {
13243
+ const node = wearing(createConfig('Image'), 'media');
13244
+ if (!node)
13245
+ return null;
13246
+ setTrait(node, 'src', src);
13247
+ return styled(node, { width: '100%', height: 'auto', aspectRatio });
13248
+ }
13249
+ function card(copy, createConfig, index) {
13250
+ return boxed('card', createConfig, [
13251
+ picture(createConfig, '4 / 3', index === 0 ? copy.photo : ''),
13252
+ heading('h3', copy.cardTitle, 'h3', createConfig),
13253
+ text(copy.cardText, createConfig, 'small'),
13254
+ ], { display: 'grid', gap: '8px', alignContent: 'start', minWidth: '0' });
13255
+ }
13256
+ function wordmark(copy, createConfig) {
13257
+ return text(copy.name, createConfig, undefined, {
13258
+ fontFamily: 'var(--iox-font-display)', fontWeight: 'var(--iox-weight-display)', fontSize: '18px', color: 'var(--iox-text)',
13259
+ });
13260
+ }
13261
+ function homeView(copy, createConfig, opts) {
13262
+ const words = withChildren(styled(box(createConfig), { display: 'grid', gap: '14px', maxWidth: '640px' }), [
13263
+ text(copy.eyebrow, createConfig, 'eyebrow'),
13264
+ heading('display', copy.headline, 'h1', createConfig),
13265
+ text(copy.lead, createConfig, 'lead'),
13266
+ withChildren(styled(box(createConfig), { display: 'flex', flexWrap: 'wrap', gap: '12px' }), [
13267
+ button('button-primary', copy.primary, createConfig),
13268
+ button('button-secondary', copy.secondary, createConfig),
13269
+ ]),
13270
+ ]);
13271
+ const hero = block(createConfig, SpecimenFamily.Hero, opts, [words], { [EntrancePart.HeroText]: [words] });
13272
+ const listHeading = heading('h2', copy.listHeading, 'h2', createConfig);
13273
+ const cards = Array.from({ length: CARD_COUNT }, (_, i) => card(copy, createConfig, i));
13274
+ const cardRow = withChildren(styled(box(createConfig), { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: '14px' }), cards);
13275
+ const collection = block(createConfig, SpecimenFamily.Collection, opts, [listHeading, cardRow], { [EntrancePart.Heading]: [listHeading], [EntrancePart.Items]: cards });
13276
+ const rowPicture = picture(createConfig, '16 / 10');
13277
+ const rowHeading = heading('h2', copy.rowHeading, 'h2', createConfig);
13278
+ const rowWords = withChildren(styled(box(createConfig), { display: 'grid', gap: '10px', alignContent: 'center' }), [rowHeading, text(copy.rowText, createConfig, 'body')]);
13279
+ const feature = block(createConfig, SpecimenFamily.Feature, opts, [rowPicture, rowWords], { [EntrancePart.Heading]: [rowHeading], [EntrancePart.RowMedia]: [rowPicture] }, { gridTemplateColumns: 'minmax(0, 1.1fr) minmax(0, 1fr)', gap: '18px', alignItems: 'start' });
13280
+ const field = createConfig('Field');
13281
+ if (field) {
13282
+ setTrait(field, 'label', copy.fieldLabel);
13283
+ setTrait(field, 'control', 'email');
13284
+ }
13285
+ const formHeading = heading('h3', copy.formHeading, 'h3', createConfig);
13286
+ const contactCard = boxed('card', createConfig, [formHeading, field ?? null, button('button-primary', copy.send, createConfig, { justifySelf: 'start' })], { display: 'grid', gap: '14px', alignContent: 'start', maxWidth: '420px' });
13287
+ const contact = block(createConfig, SpecimenFamily.Contact, opts, [contactCard], { [EntrancePart.Heading]: [formHeading] });
13288
+ return [hero, collection, feature, contact];
13289
+ }
13290
+ function itemView(copy, createConfig, opts) {
13291
+ const title = heading('display', copy.cardTitle, 'h1', createConfig);
13292
+ const media = picture(createConfig, '16 / 8', copy.photo);
13293
+ return [block(createConfig, SpecimenFamily.Detail, opts, [text(copy.listHeading, createConfig, 'eyebrow'), title, media, text(copy.cardText, createConfig, 'lead')], { [EntrancePart.Heading]: [title], [EntrancePart.Media]: [media] })];
13294
+ }
13295
+ /**
13296
+ * The Design step's canvas (AI plan rev 3.1 §3o, H4-1): the business's own name and words, in four blocks a real
13297
+ * page would have — a hero (wordmark, eyebrow, headline, lead, two buttons), a collection (a heading, three
13298
+ * cards), a feature row (a picture beside a heading and a paragraph) and a contact card (one field and its
13299
+ * button) — or, as `BusinessSpecimenView.Item`, one card opened. Ordinary nodes wearing element styles, rendered
13300
+ * through `[ioxRender]` like every specimen; display-only. Each block carries the entrances the look's How
13301
+ * animated stamps (the shared `sectionEntrances`), played by the canvas's own interaction runtime. No navigation
13302
+ * and no page names. A right-to-left business is drawn by its host's `dir`; only a side picture's slide mirrors here.
13303
+ */
13304
+ function buildBusinessSpecimen(copy, createConfig, opts = {}) {
13305
+ const blocks = opts.view === BusinessSpecimenView.Item ? itemView(copy, createConfig, opts) : homeView(copy, createConfig, opts);
13306
+ const root = withChildren(styled(box(createConfig), { display: 'grid', gap: '28px', alignContent: 'start', padding: '30px 36px 36px', width: '100%' }), [wordmark(copy, createConfig), ...blocks]);
13307
+ if (root)
13308
+ root.label = 'Business specimen';
13309
+ return markSpecimen(root);
13310
+ }
13189
13311
 
13190
13312
  /**
13191
13313
  * Dialog (actions plan A1b) — an ordinary container whose children are normal nodes, rendered
@@ -14131,5 +14253,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
14131
14253
  * Generated bundle index. Do not edit.
14132
14254
  */
14133
14255
 
14134
- export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SILENT_REFUSALS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTriggerOf, dropChildren, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, insertRefusal, insertRefusalLabel, interactionTargets, isHiddenAt, isHiddenAtRest, isPinnedGlobal, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setStyleTrait, setTrait, shortDescriptor, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
14256
+ export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SILENT_REFUSALS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTriggerOf, dropChildren, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, insertRefusal, insertRefusalLabel, interactionTargets, isHiddenAt, isHiddenAtRest, isPinnedGlobal, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setStyleTrait, setTrait, shortDescriptor, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
14135
14257
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map